#include "at7456e.h"

#if ChengDu 
//IR
unsigned char IR_Polar_WHot_Cmd[] 			= {0x68, 0x11, 0x03, 0x01, 0x00, 0x00, 0x83,0x00, 0x02, 0x01, 0x03,'\r'};
unsigned char IR_Polar_BHot_Cmd[] 			= {0x68, 0x11, 0x03, 0x01, 0x00, 0x00, 0x84, 0x00, 0x02, 0x01, 0x04,'\r'};
unsigned char IR_Polar_RainBow_Cmd[] 		= {0x68, 0x11, 0x03, 0x01, 0x00, 0x00, 0x80, 0x00, 0x02, 0x01, 0x00,'\r'};
unsigned char IR_Polar_Green_Cmd[] 			= {0x68, 0x11, 0x03, 0x01, 0x00, 0x00, 0x81, 0x00, 0x02, 0x01, 0x01,'\r'};
unsigned char IR_Polar_Iron_Cmd[] 			= {0x68, 0x11, 0x03, 0x01, 0x00, 0x00, 0x82, 0x00, 0x02, 0x01, 0x02,'\r'};
		
unsigned char IR_Bright_Cmd[] 				= {0x68, 0x24, 0x04, 0x01, 0x00, 0x00, 0Xff, 0Xff, 0x02, 0x00, 0X66, 0x00,'\r'};
unsigned char IR_Contract_Cmd[] 			= {0x68, 0x24, 0x04, 0x01, 0x00, 0x00, 0X66, 0X66, 0x02, 0x01, 0X66, 0x00,'\r'};
unsigned char IR_DDEBase_Cmd[] 				= {0x68, 0x24, 0x04, 0x01, 0x00, 0x00, 0Xff, 0Xff, 0x02, 0x02, 0Xdd, 0xdd,'\r'};
unsigned char IR_DDE_Cmd[] 					= {0x68, 0x24, 0x04, 0x01, 0x00, 0x00, 0X66, 0X66, 0x02, 0x03, 0Xdd, 0xdd,'\r'};
unsigned char IR_DNR_Cmd[] 					= {0x68, 0x24, 0x04, 0x01, 0x00, 0x00, 0X66, 0X66, 0x02, 0x05, 0X66, 0x00,'\r'};
unsigned char IR_ZOOM_Cmd[] 				= {0x68, 0x24, 0x03, 0x01, 0x00, 0x00, 0X66, 0X66, 0x04, 0x01, 0X66, '\r'};
unsigned char IR_GEAR_Cmd[] 				= {0x68, 0x24, 0x03, 0x01, 0x00, 0x00, 0X96, 0X00, 0x03, 0x02, 0X01, '\r'};
	
//PAL隔行
unsigned char IR_BT656_PAL1_Cmd[]			= {0X68,0X24,0X04,0X01,0X00,0X00,0X9B,0X00,0X09,0X01,0X00,0X00,'\r'};
//PAL逐行
unsigned char IR_BT656_PAL2_Cmd[]			= {0X68,0X24,0X04,0X01,0X00,0X00,0X9C,0X00,0X09,0X01,0X00,0X01,'\r'};
//条纹去噪
unsigned char IR_BT656_StripeDenoising_Cmd[]= {0X64,0X24,0X04,0X01,0X00,0X00,0XFF,0XFF,0x02,0x07,0X00,0X01,'\r'};
#elif BT656
//IR

unsigned char IR_BT656_PAL_ON[]               = {0x87, 0x11, 0xe5, 0xaa, 0x27,'\r'};

unsigned char IR_Polar_WHot_Cmd[] 			= {0XAA, 0XB2, 0X00, 0X00, 0X00, 0X00, 0X00, 0XB2,'\r'};
unsigned char IR_Polar_BHot_Cmd[] 			= {0XAA, 0XB2, 0X01, 0X00, 0X00, 0X00, 0X00, 0XB3,'\r'};
unsigned char IR_Polar_Iron_Cmd[] 			= {0XAA, 0XB2, 0X02, 0X00, 0X00, 0X00, 0X00, 0XB4,'\r'};
unsigned char IR_Polar_Green_Cmd[] 			= {0XAA, 0XB2, 0X04, 0X00, 0X00, 0X00, 0X00, 0XB6,'\r'};
		
unsigned char IR_Bright_Cmd[] 				= {0XAA, 0XB0, 0X32, 0X00, 0X00, 0X00, 0X00, 0XE2,'\r'};
unsigned char IR_Contract_Cmd[] 			= {0XAA, 0XB1, 0X32, 0X00, 0X00, 0X00, 0X00, 0XE3,'\r'};
unsigned char IR_DDE_Cmd[] 					= {0XAA, 0XBC, 0X04, 0X00, 0X00, 0X00, 0X00, 0XC0,'\r'};


unsigned char IR_OutDoor_ON_Cmd[] 			= {0XAA, 0XC4, 0X01, 0X00, 0X00, 0X00, 0X00, 0XC5,'\r'};
unsigned char IR_OutDoor_OFF_Cmd[] 			= {0XAA, 0XC4, 0X00, 0X00, 0X00, 0X00, 0X00, 0XC4,'\r'};

unsigned char IR_Hot_Point_ON_Cmd[]         = {0XAA, 0XB3, 0X01, 0X00, 0X00, 0X00, 0X00, 0XB4,'\r'};
unsigned char IR_Hot_Point_OFF_Cmd[]        = {0XAA, 0XB3, 0X00, 0X00, 0X00, 0X00, 0X00, 0XB3,'\r'};


unsigned char IR_ZOOM_Cmd[] 				= {0x68, 0x24, 0x03, 0x01, 0x00, 0x00, 0X66, 0X66, 0x04, 0x01, 0X66, '\r'};
	

//PAL隔行
unsigned char IR_BT656_PAL1_Cmd[]			= {0X68,0X24,0X04,0X01,0X00,0X00,0X9B,0X00,0X09,0X01,0X00,0X00,'\r'};
//PAL逐行
unsigned char IR_BT656_PAL2_Cmd[]			= {0X68,0X24,0X04,0X01,0X00,0X00,0X9C,0X00,0X09,0X01,0X00,0X01,'\r'};
//条纹去噪
unsigned char IR_BT656_StripeDenoising_Cmd[]= {0X64,0X24,0X04,0X01,0X00,0X00,0XFF,0XFF,0x02,0x07,0X00,0X01,'\r'};



#endif

#if VL_MC_105Q  
//VL		
unsigned char VL_Reboot_Cmd[] 				= {0x81, 0x01, 0x04, 0x00, 0x03, 0xFF,'\r' }; //重启
		
unsigned char VL_Mode_Auto_Cmd[] 			= {0x81, 0x01, 0x04, 0x51, 0x02, 0xFF,'\r'};//
unsigned char VL_Mode_Day_Cmd[] 			= {0x81, 0x01, 0x04, 0x01, 0x03, 0xFF,'\r'}; //彩色模式开
unsigned char VL_Mode_Night_Cmd[] 			= {0x81, 0x01, 0x04, 0x01, 0x02, 0xFF,'\r'};  //黑白模式开                                //黑白模式开

unsigned char VL_Mode_Defog_ON_Cmd[] 		= {0x81,	0x01,	0x04,	0x65,	0x02,	0xFF,'\r'};
unsigned char VL_Mode_Defog_OFF_Cmd[] 		= {0x81,	0x01,	0x04,	0x65,	0x03,	0xFF,'\r'};
unsigned char VL_Mode_Defog_Low_Cmd[] 		= {0x81,	0x01,	0x04,	0x65,	0x30,	0x00, 0xFF,'\r'};
unsigned char VL_Mode_Defog_Mid_Cmd[] 		= {0x81,	0x01,	0x04,	0x65,	0x30,	0x01, 0xFF,'\r'};
unsigned char VL_Mode_Defog_Hig_Cmd[] 		= {0x81,	0x01,	0x04,	0x65,	0x30,	0x02, 0xFF,'\r'};

unsigned char VL_Bright_Cmd[]   			= {0x81, 0x01, 0x05, 0x5e, 0x00, 0x00, 0x00, 0x06, 0xFF,'\r'};//{0x81, 0x01, 0x04, 0x4D, 0x00, 0x00, 0x00, 0x06, 0xFF,'\r'};

unsigned char VL_Contract_Cmd[]   			= {0x81, 0x01, 0x05, 0x5D, 0x00, 0x00, 0x00, 0x06, 0xFF,'\r'};

//动态调整
unsigned char VL_DWDR_Off_Cmd[]   			= {0x81, 0x01, 0x04, 0x1A, 0x03, 0xFF,'\r'};
unsigned char VL_DWDR_On_Cmd[]   			= {0x81, 0x01, 0x04, 0x1A, 0x02, 0xFF,'\r'};
unsigned char VL_DWDR_AutoMode_Cmd[]   		= {0x81, 0x01, 0x04, 0x1A, 0x20, 0x01, 0xFF, '\r'};
unsigned char VL_DWDR_ManualMode_Cmd[]   	= {0x81, 0x01, 0x04, 0x1A, 0x20, 0x00, 0xFF, '\r'};
unsigned char VL_DWDR_Low_Cmd[]   			= {0x81, 0x01, 0x04, 0x1A, 0x30, 0x00, 0xFF,'\r'};
unsigned char VL_DWDR_Mid_Cmd[]   			= {0x81, 0x01, 0x04, 0x1A, 0x30, 0x01, 0xFF,'\r'};
unsigned char VL_DWDR_Hig_Cmd[]   			= {0x81, 0x01, 0x04, 0x1A, 0x30, 0x02, 0xFF,'\r'};

//降噪
unsigned char VL_DNR_Cmd[]   				= {0x81, 0x01, 0x04, 0x53, 0x66, 0xFF,'\r'};

//缩放
unsigned char VL_ZoomStop_Cmd[]				= {0x81, 0x01, 0x04, 0x07, 0x00, 0xFF,'\r'};
unsigned char VL_DZoomON_Cmd[]				= {0x81, 0x01, 0x04, 0x06, 0x02, 0xFF,'\r'};
unsigned char VL_DZoomOFF_Cmd[]				= {0x81, 0x01, 0x04, 0x06, 0x03, 0xFF,'\r'};
unsigned char VL_DZoomStop_Cmd[]			= {0x81, 0x01, 0x04, 0x06, 0x03, 0xFF,'\r'};
unsigned char VL_DZoom_SepatateMode_Cmd[]	= {0x81, 0x01, 0x04, 0x36, 0x01, 0xFF,'\r'};
unsigned char VL_DZoom_CombineMode_Cmd[]	= {0x81, 0x01, 0x04, 0x36, 0x00, 0xFF,'\r'};

unsigned char VL_DZoom_PresetOFF_Cmd[]		= {0x81, 0x01, 0x04, 0x1E, 0x03, 0xFF,'\r'};

unsigned char VL_DZoomSet_Cmd[]				= {0x81, 0x01, 0x04, 0x46, 0x00, 0x00, 0x0e, 0x0e, 0xFF,'\r'};
unsigned char VL_ZoomSet_Cmd[]				= {0x81, 0x01, 0x04, 0x47, 0xa, 0x0b ,0x0c, 0x0d, 0xFF,'\r'};	


unsigned char WifiTakephoto_Cmd[] 			= {0x55,0XAA,0X02,0X01,0X02,0XFF,'\r'}; 	//拍一张照片

#elif VL_YT_3578_HD  

unsigned char VL_Reboot_Cmd[] 				= {0x81, 0x01, 0x04, 0x00, 0x03, 0xFF,'\r' }; //重启
		
unsigned char VL_Mode_Auto_Cmd[] 		= {0x02, 0x33, 0x0C, 0x00, 0x00, 0x03,'\r'}; //自动色彩模式
unsigned char VL_Mode_Day_Cmd[] 			= {0x02, 0x33, 0x0C, 0x01, 0x00, 0x03,'\r'}; //彩色模式开
unsigned char VL_Mode_Night_Cmd[] 		= {0x02, 0x33, 0x0C, 0x02, 0x00, 0x03,'\r'}; //黑白模式开                                //黑白模式开

unsigned char VL_Mode_Defog_ON_Cmd[] 	= {0x02, 0x33, 0x16, 0x01, 0x00, 0x03,'\r'}; //开启透雾
unsigned char VL_Mode_Defog_OFF_Cmd[] 	= {0x02, 0x33, 0x16, 0x01, 0x00, 0x03,'\r'}; //关闭透雾
unsigned char VL_Mode_Defog_Low_Cmd[] 	= {0x02, 0x33, 0x17, 0x00, 0x00, 0x03,'\r'}; //低级透雾
unsigned char VL_Mode_Defog_Mid_Cmd[] 	= {0x02, 0x33, 0x17, 0x01, 0x00, 0x03,'\r'}; //中级透雾
unsigned char VL_Mode_Defog_Hig_Cmd[] 	= {0x02, 0x33, 0x17, 0x02, 0x00, 0x03,'\r'}; //高级透雾


unsigned char VL_Bright_Cmd[]   			= {0x02, 0x33, 0x00, 0x0E, 0x00, 0x03,'\r'};//{0x81, 0x01, 0x04, 0x4D, 0x00, 0x00, 0x00, 0x06, 0xFF,'\r'};

unsigned char VL_Contract_Cmd[]   			 = {0x02, 0x33, 0x0E, 0x00, 0x00, 0x03,'\r'};//色彩浓度设置


//动态调整
unsigned char VL_DWDR_Low_Cmd[]   		=  {0x02, 0x33, 0x0B, 0x00, 0x00, 0x03,'\r'};//
unsigned char VL_DWDR_Mid_Cmd[]   		=  {0x02, 0x33, 0x0B, 0x01, 0x00, 0x03,'\r'};//
unsigned char VL_DWDR_Hig_Cmd[]   		=  {0x02, 0x33, 0x0B, 0x02, 0x00, 0x03,'\r'};//

//降噪
unsigned char VL_DNR_Off_Cmd[]   		  =  {0x02, 0x33, 0x0F, 0x00, 0x00, 0x03,'\r'};
unsigned char VL_DNR_Low_Cmd[]   		  =  {0x02, 0x33, 0x0F, 0x01, 0x00, 0x03,'\r'};
unsigned char VL_DNR_Mid_Cmd[]   		  =  {0x02, 0x33, 0x0F, 0x02, 0x00, 0x03,'\r'};
unsigned char VL_DNR_Hig_Cmd[]   			=  {0x02, 0x33, 0x0F, 0x03, 0x00, 0x03,'\r'};


//缩放
unsigned char VL_ZoomStop_Cmd[]				= {0x81, 0x01, 0x04, 0x07, 0x00, 0xFF,'\r'};
unsigned char VL_DZoomON_Cmd[]				= {0x81, 0x01, 0x04, 0x06, 0x02, 0xFF,'\r'};
unsigned char VL_DZoomOFF_Cmd[]				= {0x81, 0x01, 0x04, 0x06, 0x03, 0xFF,'\r'};
unsigned char VL_DZoomStop_Cmd[]			= {0x81, 0x01, 0x04, 0x06, 0x03, 0xFF,'\r'};
unsigned char VL_DZoom_SepatateMode_Cmd[]	= {0x81, 0x01, 0x04, 0x36, 0x01, 0xFF,'\r'};
unsigned char VL_DZoom_CombineMode_Cmd[]	= {0x81, 0x01, 0x04, 0x36, 0x00, 0xFF,'\r'};

unsigned char VL_DZoom_PresetOFF_Cmd[]		= {0x81, 0x01, 0x04, 0x1E, 0x03, 0xFF,'\r'};


unsigned char VL_DZoomSet_Cmd[]				= {0x81, 0x01, 0x04, 0x46, 0x00, 0x00, 0x0e, 0x0e, 0xFF,'\r'};
unsigned char VL_ZoomSet_Cmd[]				= {0x81, 0x01, 0x04, 0x47, 0xa, 0x0b ,0x0c, 0x0d, 0xFF,'\r'};	

unsigned char VL_AZoomSet_Cmd[]			 =  {0x02, 0x33, 0x15, 0x00, 0x00, 0x03,'\r'};	//数字变倍指令

unsigned char WifiTakephoto_Cmd[] 			= {0x55,0XAA,0X02,0X01,0X02,0XFF,'\r'}; 	//拍一张照片
#endif


//共有
//wifi
unsigned char IR_VL_WiFi_ON_Cmd[]   		= {0x55,0XAA,0X00,0X01,0X00,0XFF,'\r'};
unsigned char IR_VL_WiFi_OFF_Cmd[]   		= {0x55,0XAA,0X00,0X00,0XFF,0XFF,'\r'};
//录像
unsigned char IR_VL_DVR_ON_Cmd[]   			= {0x55,0XAA,0X01,0X01,0X01,0XFF,'\r'};
unsigned char IR_VL_DVR_OFF_Cmd[]   		= {0x55,0XAA,0X01,0X00,0X00,0XFF,'\r'};




unsigned char Take_Photo_1718_Cmd[]            = {0xCC,0x03,0x20,0x01,0xF0,'\r'};
unsigned char Start_Stop_Recording_1718_Cmd[]  = {0xCC,0x03,0x20,0x02,0xF1,'\r'};
unsigned char Stop_Recording_1718_Cmd[]        = {0xCC,0x03,0x20,0x03,0xF2,'\r'};





//unsigned char VL_ColorOff_Cmd[] = {0x81, 0x01, 0x04, 0x01, 0x03, 0xFF, '\r' };//彩色模式关
//unsigned char VL_MonoOff_Cmd[] 	= {0x81, 0x01, 0x04, 0x01, 0x02, 0xFF, '\r'};//黑白模式关
//unsigned char VL_DefogOff_Cmd[] = {0x81, 0x01, 0x04, 0x65, 0x03, 0xFF, '\r'};//透雾模式关

//亮度
typedef enum
{
	Bright_1 = 0,
	Bright_2,
	Bright_3,
	Bright_4,
	Bright_5,
	Bright_6,
	Bright_7,
	Bright_8,
	Bright_9,
	Bright_10,
	Bright_11,
	Bright_12,
	Bright_13,
	Bright_14,
}_Bright_Value;

//对比度
typedef enum
{
	Contrast_1 = 0,
	Contrast_2,
	Contrast_3,
	Contrast_4,
	Contrast_5,
	Contrast_6,
	Contrast_7,
	Contrast_8,
	Contrast_9,
	Contrast_10,
	Contrast_11,
	Contrast_12,
	Contrast_13,
	Contrast_14,
}_Contrast_Value;






VER7456 newAt7456;

#if BT656 
void BT656_Init(void)
{
  Uart7Send(IR_BT656_PAL_ON, MyStrlen(IR_BT656_PAL_ON));

}
#endif

// AT7456 显示字符
void DisplayChar(unsigned char row, unsigned char col, unsigned char c)
{
	unsigned int kk;
	kk = row * 30 + col;
	write_at7456_addr_data(DMAH, kk / 256); // kk=0 写入或读取字符地址
	write_at7456_addr_data(DMAL, kk % 256); // 屏上显示的位置   
	write_at7456_addr_data(DMDI, c);
}

// 显示数字 0..9
void DisplayNum(unsigned char row, unsigned char col, unsigned char c)
{
	unsigned int kk;
	kk = row * 30 + col;
	write_at7456_addr_data(DMAH, kk / 256); // address
	write_at7456_addr_data(DMAL, kk % 256);
	write_at7456_addr_data(DMDI, (c == 0) ? 10 : c);
}

// 显示的字符串为字符和数字以及空格
void DisplayString(unsigned char row, unsigned char col, unsigned char *s)
{
	unsigned int kk;
	unsigned char c;
	kk = row * 30 + col;
	write_at7456_addr_data(DMAH, kk / 256); // kk=0 写入或读取字符地址
	write_at7456_addr_data(DMAL, kk % 256); //屏上显示的位置 
	write_at7456_addr_data(DMM, 0x01); // Auto Inc
	c = *s++;
	while (c != 0)
	{
		if ((c >= '0') && (c <= '9'))
		    write_at7456_data((c == '0') ? 10 : c - '1' + 1);
		else if ((c >= 'A') && (c <= 'Z'))
		    write_at7456_data(c - 'A' + 11);
		else if ((c >= 'a') && (c <= 'z'))
		    write_at7456_data(c - 'a' + 37);
		else if (c == ' ')
		    write_at7456_data(0x00);
		else if (c == '(')
		    write_at7456_data(0x3f);
		else if (c == ')')
			  write_at7456_data(0x40);
		else if (c == '.')
		    write_at7456_data(0x41);
		else if (c == '?')
		    write_at7456_data(0x42);
		else if (c == ';')
		    write_at7456_data(0x43);
		else if (c == ':')
		    write_at7456_data(0x44);
		else if (c == ',')
		    write_at7456_data(0x45);
		else if (c == '\'')
		    write_at7456_data(0x46);
		else if (c == '/')
		    write_at7456_data(0x47);
		else if (c == '"')
		    write_at7456_data(0x48);
		else if (c == '-')
		    write_at7456_data(0x49);
		else if (c == '<')
		    write_at7456_data(0x4a);
		else if (c == '>')
		    write_at7456_data(0x4b);
		else if (c == '@')
		    write_at7456_data(0x4c);
		else
				write_at7456_data(c);
				c = *s++;
				kk++;
   }
 write_at7456_data(0xff); // Exit Auto Inc
}

//// AT7456(E)复位
//void //at7456_reset(void)
//{
//	// 先软件复位，主要是针对没有连接 nRESET 的外部 7456
//	write_at7456_addr_data(VM0, 2);
//	delay_ms(60); // 复位时间至少为 50ms
//	gpio_bits_reset(GPIOC, GPIO_Pin_5); // nRST = 0
//	
//	delay_ms(60); // 复位脉冲宽度至少为 50ms
//	gpio_bits_set(GPIOC, GPIO_Pin_5); // nRST = 1
//	delay_ms(60); // 至少 40ms，否则无法将字符写入芯片
//}


// 关闭 OSD
void turnOff_osd(void)
{
	unsigned char k;
	k = read_at7456_addr_data(VM0);
	write_at7456_addr_data(VM0, k & ~(1 << 3)); // VM0[3]=0，禁止 OSD
	//delay_us(30);
	//vTaskDelay(1);
}
// 打开 OSD
void turnOn_osd(void)
{
	unsigned char k;
	k = read_at7456_addr_data(VM0);
	write_at7456_addr_data(VM0, k | (1 << 3)); // VM0[3]=1，打开 OSD
	//delay_us(30);
}
// 清屏， 0 地址为空格
void clear_screen(void)
{
	unsigned int i;
	write_at7456_addr_data(DMAH, 0x00); // address
	write_at7456_addr_data(DMAL, 0);
	write_at7456_addr_data(DMM, 0x01); // 地址自动递增
	for (i = 0; i < (16*30); i++)
	{
	  write_at7456_data(0);
	}
	write_at7456_data(0xff); // 退出自动递增模式
}

// 通过写入/读出 VM0.7 来判断 AT7456 的版本问题，新版可以读写 VM0.7 位
// 防止 SPI 接口开路或短路，需要有 0、 1 两种状态
VER7456 checkAT7456(void)
{
	unsigned char r1, r2;
	r1 = read_at7456_addr_data(VM0);
	r2 = (r1 & ~(1 << 1)) | 0x88; // VM0.1(Software Reset Bit) = 0，同时将 VM0.3 置位 1
	write_at7456_addr_data(VM0, r2); // 写 VM0
	delay_us(30);
	r2 = read_at7456_addr_data(VM0) & 0x88;
	write_at7456_addr_data(VM0, r1); // 恢复 VM0
	delay_us(30);
	if (r2 == 0x88)
	 return NEW7456; // 新版 7456
	else if (r2 == 0x08)
	 return OLD7456; // 老版 7456
	else
	 return BAD7456; // SPI 接口异常
}

void configOSDBL(unsigned char autoLevelCtrl)
{
	unsigned char k;
	k = read_at7456_addr_data(OSDBL);
	if (autoLevelCtrl)
	// 复位后将 OSDBL.4 强制清零 --- 强制打开自动电平控制
	k &= ~(1 << 4);
	else
	// 复位后将 OSDBL.4 强制置 1 --- 强制关闭自动电平控制
	k |= (1 << 4);
	write_at7456_addr_data(OSDBL, k);
}

// 更新字库
// addr : 字库地址， 0 .. 255
// dt : 存放 54 字节字库数据的地址
void write_at7456_font(unsigned char addr, unsigned char *dt)
{
unsigned char n;
	write_at7456_addr_data(CMAH, addr); // 字库地址
	for (n=0; n<54; n++)
	{
	write_at7456_addr_data(CMAL, n);
	write_at7456_addr_data(CMDI, *dt++); // 写内部镜像 RAM
	}
	write_at7456_addr_data(CMM, RAM_NVM); // 将内部镜像 RAM 中的字库数据写到 NVM
	// AT7456 = 2.92ms
	wait_memory_wr_ok(); // STAT[5] = 0, 表示写操作完成, MAX7456 约 10ms
}


// 读字库数据
// addr : 字库地址， 0 .. 255
// dt : 存放 54 字节字库数据的地址
void read_at7456_font(unsigned char addr, unsigned char *dt)
{
	unsigned char n;
	write_at7456_addr_data(CMAH, addr);
	// 一次性读取 54 字节字库数据
	write_at7456_addr_data(CMM, NVM_RAM); // 从 NVM 读取字库数据到内部镜像 RAM
	delay_us(20); // AT7456 需要 20us 以上时间
	for (n=0; n<54; n++)
	{
		write_at7456_addr_data(CMAL, n);
		*dt++ = read_at7456_addr_data(CMDO);
	}
}

/*
AT7456E 字库读写， 512 个字库
*/
#define AUTO_INC_DIS 0 // 启用地址自动递增，速度更快
//#define AUTO_INC_DIS 1 // 禁止地址自动递增
// 更新字库
// addr : 字库地址， 0 .. 511
// dt : 存放 54 字节字库数据的地址
void write_at7456E_font(unsigned short addr, unsigned char *dt)
{
	unsigned char addr_h, n;
	addr_h = (addr >> 8);
	write_at7456_addr_data(CMAH, addr); // 写字库低 8 位地址
	if (AUTO_INC_DIS)
	write_at7456_addr_data(DMM, 0); // 不自动递增
	else
	{
		write_at7456_addr_data(CMAL, (addr_h << 6)); // D6 --- 字库页面
		write_at7456_addr_data(DMM, 0x80); // CMAL 自动递增
	}
	for (n = 0; n < 54; n++)
	{
		if (AUTO_INC_DIS) {
		write_at7456_addr_data(CMAL, n | (addr_h << 6)); // D6 --- 字库页面
		write_at7456_addr_data(CMDI, *dt++); // 写内部镜像 RAM
	}
	else
		write_at7456_data(*dt++);
	}
	write_at7456_addr_data(CMM, RAM_NVM); // 将内部镜像 RAM 中的字库数据写到 NVM
	// AT7456 = 2.92ms
	wait_memory_wr_ok(); // STAT[5] = 0, 表示写操作完成, MAX7456 约 10ms
}


// 读字库数据
// addr : 字库地址， 0 .. 511
// dt : 存放 54 字节字库数据的地址
void read_at7456E_font(unsigned short addr, unsigned char *dt)
{
	unsigned char addr_h, n;
	addr_h = (addr >> 8);
	write_at7456_addr_data(CMAH, addr);
	write_at7456_addr_data(CMAL, (addr_h << 6)); // D6 --- 字库页面
	// 一次性读取 54 字节字库数据
	write_at7456_addr_data(CMM, NVM_RAM); // 从 NVM 读取字库数据到内部镜像 RAM， 0.5us
	delay_us(30); // AT7456E 需要 15.5us 以上时间
	for (n = 0; n < 54; n++)
	{
		write_at7456_addr_data(CMAL, n);
		*dt++ = read_at7456_addr_data(CMDO);
	}
}

void wait_memory_wr_ok(void)
{
//for(uint16_t i=0 ;i<1000;i++)
//{
//	for(uint16_t p=0 ;p<1000;p++)
//	;
//}
	// 实测为 38.8ms
	while ((read_at7456_addr_data(STAT) & (1<<5)) != 0); // STAT[5] = 0 --- Available to Operate
	while ((read_at7456_addr_data(DMM) & (1<<2)) != 0); // DMM[2] = 0 --- Available to Operate
}

/*
字符读写，仅适用于采用前 256 个字库的字符
*/
// row：显示字符行号（0..15）； col：显示字符的列号（0..29）
// ca：读取到的字符参数
void at7456_read_char(unsigned char row, unsigned char col, CHAR_ATTRIB *ca)
{
	unsigned short k;
	k = row * 30 + col;
	write_at7456_addr_data(DMM, (0 << 6)); // 16bit 模式
	write_at7456_addr_data(DMAH, k >> 8); // 显示位置，高 1 位，读字符， D1=0
	write_at7456_addr_data(DMAL, k); // 显示位置，低 8 位
	ca->index = read_at7456_addr_data(DMDO); // 字符在字库中的地址
	ca->attrib = read_at7456_data() >> 4; // 字符属性
}

// row：显示字符行号（0..15）； col：显示字符的列号（0..29）
// ca：待写字符参数
void at7456_write_char(unsigned char row, unsigned char col, CHAR_ATTRIB *ca)
{
	unsigned short k;
	write_at7456_addr_data(DMM, ca->attrib << 3); // 16bit 模式, D6 = 0
	k = row * 30 + col;
	write_at7456_addr_data(DMAH, k >> 8); // 显示位置，高 1 位
	write_at7456_addr_data(DMAL, k); // 显示位置，低 8 位
	write_at7456_addr_data(DMDI, ca->index); // 待显示字符
}

/*
AT7456E 字符读写，也适用于 AT7456
*/
// row：显示字符行号（0..15）； col：显示字符的列号（0..29）
// ca：读取到的字符参数
void at7456E_read_char(unsigned char row, unsigned char col, CHAR_ATTRIB *ca)
{
	unsigned short k;
	unsigned char addr_h, j;
	k = row * 30 + col;
	addr_h = k >> 8;
	// 先读字符
	write_at7456_addr_data(DMM, (1 << 6)); // 按 8 位模式读显示字符(读屏)
	write_at7456_addr_data(DMAH, addr_h); // D0 - 显示位置，高 1 位; D1=0，读字符
	write_at7456_addr_data(DMAL, k); // 显示位置，低 8 位
	ca->index = read_at7456_addr_data(DMDO); // 读取到字符的低 8 位字库地址
	// 后读属性（内含字符的高位字库地址）
	write_at7456_addr_data(DMAH, addr_h | 2); // D0 - 显示位置，高 1 位; D1=1，读属性
	write_at7456_addr_data(DMAL, k); // 显示位置，低 8 位
	j = read_at7456_addr_data(DMDO); // D7..D5 - 属性; D4 --- CA[8]
	ca->attrib = j >> 5;
	if (j & (1 << 4))
	ca->index |= 0x100;
}


// row：显示字符行号（0..15）； col：显示字符的列号（0..29）
// ca：待写字符参数
void at7456E_write_char(unsigned char row, unsigned char col, CHAR_ATTRIB *ca)
{
	unsigned short k;
	unsigned char addr_h, j;
	k = row * 30 + col;
	addr_h = k >> 8;
	// 先写属性
	write_at7456_addr_data(DMM, (1 << 6)); // 按 8 位模式写显示字符(写屏)
	write_at7456_addr_data(DMAH, addr_h | 0x2); // D0 - 显示位置，高 1 位; D1 - 属性
	write_at7456_addr_data(DMAL, k); // 显示位置，低 8 位
	j = ca->attrib << 5; // 属性， DMDI[7..5]
	if ((ca->index >> 8) != 0)
	j |= 0x10; // 属性中加入字库页面标志, D4 = CA[8]
	write_at7456_addr_data(DMDI, j);
	// 再写字符
	write_at7456_addr_data(DMAH, addr_h);
	write_at7456_addr_data(DMAL, k);
	write_at7456_addr_data(DMDI, ca->index); // 字符低 8 位，高 1 位已经在前面的字符属性中写入
}

// AT7456(E)复位
void at7456_reset(void)
{
	// 先软件复位，主要是针对没有连接nRESET的外部7456
	write_at7456_addr_data(VM0, 2);
	delay_ms(200);									// 复位时间至少为50ms
	
									// 至少40ms，否则无法将字符写入芯片
}
#if ChengDu
//红外亮度和校验
void IR_SumCheck(uint8_t *buf)
{
	uint8_t len,CheckLow,CheckHigh;
	uint16_t sum = 0;
	
	len = MyStrlen(buf);
	
	for(uint8_t num=0; num<6; num++)
	sum = buf[num] + sum;
	
	for(uint8_t num=8; num<12; num++)
	sum = buf[num] + sum;
	 
	CheckLow = sum & 0XFF;
	CheckHigh = (sum>>8) & 0XFF;
	
	buf[6] = CheckLow;
	buf[7] = CheckHigh;
}

#elif BT656
//红外亮度和校验
void IR_SumCheck(uint8_t *buf)
{
	uint8_t len,CheckLow,CheckHigh;
	uint16_t sum = 0;
	
	len = MyStrlen(buf);
	
	for(uint8_t num=1; num<6; num++)
	sum = buf[num] + sum;
	
	 
	CheckLow = sum & 0XFF;
	
	buf[7] = CheckLow;
}
#endif

//红外亮度和校验
void IR_ZoomMCheck(uint8_t *buf)
{
	uint8_t len,CheckLow,CheckHigh;
	uint16_t sum = 0;
	
	len = MyStrlen(buf);
	
	for(uint8_t num=0; num<6; num++)
	sum = buf[num] + sum;
	
	for(uint8_t num=8; num<11; num++)
	sum = buf[num] + sum;
	 
	CheckLow = sum & 0XFF;
	CheckHigh = (sum>>8) & 0XFF;
	
	buf[6] = CheckLow;
	buf[7] = CheckHigh;
}

void SPI2SendAndRecevice(uint8_t* sendBuff,uint8_t* reBuff,uint16_t buff_len){

    for(uint16_t i=0;i<buff_len;i++)
    {
        while(spi_i2s_flag_get(SPI2, SPI_I2S_TDBE_FLAG) == RESET){};
        spi_i2s_data_transmit(SPI2, sendBuff[i]);
        if (reBuff != NULL){
            while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET){};
            reBuff[i] = (uint8_t)spi_i2s_data_receive(SPI2);
        }else{
            while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET){};
            spi_i2s_data_receive(SPI2);
        }
    }
}

//AT7456E 初始化
void AT7654_Int(void)
{
	uint8_t n,y;
	
	
	//at7456_reset();
  //configOSDBL(0);
  // AT7456复位
	retry_VM0:	n = read_at7456_addr_data(0XA0);
	if((n&0x20) == 0);
	else
		{
			delay_ms(10);
			goto retry_VM0;
		}
			
	retry_DMM:y = read_at7456_addr_data(0x84);
	if((n&0x02) == 0);
	else
		{
			delay_ms(10);
			goto retry_DMM;
		}
	
	n = read_at7456_addr_data(0X80);
	
	delay_ms(5);	
 	delay_ms(5);	
	write_at7456_addr_data(VM0, PAL|0x08);  
	write_at7456_addr_data(VM1, 0X13);  
	write_at7456_addr_data(VOS, 0X10);//0X11);  
	write_at7456_addr_data(HOS, 0X20); 
	write_at7456_addr_data(DMM, 0X04);//0x40);  //DMM[6] = 1
	delay_ms(100);		 

	configOSDBL(0);
	write_at7456_addr_data(VM0, PAL|0X08);
	configOSDBL(0);
	write_at7456_addr_data(VM0, PAL|0X08);
}


void WriteFont_Digit(unsigned char **data)
{
	uint8_t num;
	
	for(num = 0;num<10;num++) //0-9
	{
		write_at7456E_font(0x30+num, data[num]);
		vTaskDelay(10);
	}
}

//data 字库数组地址
//FontSize 字库数组里面包含的字符个数
void WriteFontAll(unsigned char *data, uint8_t FontSize)
{
	for(uint8_t num; num<FontSize; num++)
	{
		write_at7456E_font(num, &data[num*64]);
	}
}

//写英文字库
void WriteFont_MyEnglishStr(unsigned char **data,uint8_t size,uint8_t Startaddr)
{
	uint8_t num;
	
	for(num = 0;num<size;num++)
	{
		write_at7456E_font(Startaddr+num, data[num]);
		vTaskDelay(10);
	}
}

//写中文字库
void WriteFont_MyChineseStr(unsigned char **data,uint8_t size,uint8_t Startaddr)
{
	uint8_t num;
	
	for(num = 0;num<size;num++)
	{
		write_at7456E_font(Startaddr+num, data[num]);
		vTaskDelay(10);
	}
}

//写图标字库
void WriteFont_Icon(unsigned char **data,uint8_t size)
{
	
		uint8_t num;
	
	for(num = 0;num<size;num++)
	{
		write_at7456E_font(0X20+num, data[num]);
		vTaskDelay(10);
	}
}

void WriteFont_Char(unsigned char **Uppercase, unsigned char **lowercase)
{
	uint8_t num;
	
	/*****小写字母***********/
	for(num = 0;num<26;num++) //a - z
	{
		write_at7456E_font(0x61+num, lowercase[num]);
		vTaskDelay(10);
	}
	
		/*****大写字母***********/
	for(num = 0;num<26;num++) //a - z
	{
		write_at7456E_font(0x41+num, Uppercase[num]);
		vTaskDelay(10);
	}
}





/********OSD  菜单设计**************************************/

unsigned char MyStrlen(unsigned char *arry)
{
	uint8_t num = 0,size = 0;
	
	while(1)
	{
		if(arry[num] != '\r')
		{
			size ++;
		}
		else 
			return size;
		num ++;
	}
}


unsigned char MyArrayCopy(unsigned char *src,unsigned char *dex)
{
	uint8_t num = 0;
	

	while(src[num] != '\r')
	{
		dex[num] = src[num];
		num++;
	}
	
	//num++;
	dex[num] = '\r';
	
	return 1;
}

unsigned char MyArrayCopy_LEN(unsigned char *src,unsigned char *dex,uint8_t len)
{
	uint8_t num = 0;
	
	for(num=0;num<len;num++)
	{
		dex[num] = src[num];
	}
	
	//num++;
	dex[num] = '\r';
	
	return 1;
}

//void Init_Camera(void)
//{
//	/***********VL*************/
//	Osd_Infrared_ColorMode = _WhiteHot;//白热
//	Osd_Daylight_ColorMode = _Auto; //自动
//	//放大倍数
//	VL_Zoom_DZoomSet(DefaultZoom);
//	
//	//亮度
//	OsdRefresh_Family[_VL_Brightness].Data = Default_VL_Brightness;
//	VL_Bright_Cmd[7] = OsdRefresh_Family[_VL_Brightness].Data * 2;// +1;
//	Uart6Send(VL_Bright_Cmd,MyStrlen(VL_Bright_Cmd));
//	DecToHexToAscii(OsdRefresh_Family[_VL_Brightness].Data, 0, OsdRefresh_Family[_VL_Brightness].Module_addr, 1);
//	SmallToBig(OsdRefresh_Family[_VL_Brightness].Module_addr);

//	
//	//对比度
//	OsdRefresh_Family[_VL_ContrastRatio].Data = Default_VL_Contract;				
//	VL_Contract_Cmd[7] = OsdRefresh_Family[_VL_ContrastRatio].Data * 2;	
//	Uart6Send(VL_Contract_Cmd,MyStrlen(VL_Contract_Cmd));			
//	DecToHexToAscii(OsdRefresh_Family[_VL_ContrastRatio].Data, 0, OsdRefresh_Family[_VL_ContrastRatio].Module_addr, 1);
//	SmallToBig(OsdRefresh_Family[_VL_ContrastRatio].Module_addr);
//	
//	//模式
//	OsdRefresh_Family[_VL_Mode].Data = _Auto;
//	Osd_Daylight_ColorMode = _Auto;
//	Uart6Send(VL_Mode_Defog_OFF_Cmd,MyStrlen(VL_Mode_Defog_OFF_Cmd));
//	Uart6Send(VL_Mode_Auto_Cmd,MyStrlen(VL_Mode_Auto_Cmd));
//	
//	//动态范围 DWDR
//	OsdRefresh_Family[_VL_DWDR].Data = _DWR_Off;
//	DWR_Pra = _DWR_Off;
//	Uart6Send((uint8_t*)VL_DWDR_Off_Cmd,MyStrlen(VL_DWDR_Off_Cmd));
//	
//	//降噪 DNR
//	OsdRefresh_Family[_VL_DNR].Data = Default_VL_DNR;
//	VL_DNR_Cmd[5] = OsdRefresh_Family[_VL_DNR].Data * 2;
//	Uart6Send(VL_DNR_Cmd,MyStrlen(VL_DNR_Cmd));
//	DecToHexToAscii(OsdRefresh_Family[_VL_DNR].Data, 0, OsdRefresh_Family[_VL_DNR].Module_addr, 1);
//	SmallToBig(OsdRefresh_Family[_VL_DNR].Module_addr);
//	
//	/********************IR**************/
//	//亮度
//	OsdRefresh_Family[_IR_Brightness].Data = Default_IR_Brightness;
//	IR_Bright_Cmd[10] = OsdRefresh_Family[_IR_Brightness].Data * 28;
//	IR_SumCheck(IR_Bright_Cmd);
//	Uart3Send(IR_Bright_Cmd,MyStrlen(IR_Bright_Cmd));
//	DecToHexToAscii(OsdRefresh_Family[_IR_Brightness].Data, 0, OsdRefresh_Family[_IR_Brightness].Module_addr, 1);
//	SmallToBig(OsdRefresh_Family[_IR_Brightness].Module_addr);

//	//极性
//	OsdRefresh_Family[_IR_Polar].Data = _WhiteHot;
//	Osd_Infrared_ColorMode = _WhiteHot;
//	Uart3Send(IR_Polar_WHot_Cmd,MyStrlen(IR_Polar_WHot_Cmd));
//	
//	//对比度
//	OsdRefresh_Family[_IR_ContrastRatio].Data = Default_IR_Contract;
//	IR_Contract_Cmd[10] = OsdRefresh_Family[_IR_ContrastRatio].Data * 28;
//	IR_SumCheck(IR_Contract_Cmd);
//	Uart3Send(IR_Contract_Cmd,MyStrlen(IR_Contract_Cmd));
//	DecToHexToAscii(OsdRefresh_Family[_IR_ContrastRatio].Data, 0, OsdRefresh_Family[_IR_ContrastRatio].Module_addr, 1);
//	SmallToBig(OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
//					
//	//图像增强
//	OsdRefresh_Family[_IR_Enhance].Data = Default_IR_Enhance;
//	IR_DDEBase_Cmd[10] = (OsdRefresh_Family[_IR_Enhance].Data*20 & 0xff );//基图
//	IR_DDEBase_Cmd[11] = (OsdRefresh_Family[_IR_Enhance].Data*20 >> 8 ) & 0xff ;//基图
//	IR_SumCheck(IR_DDEBase_Cmd);
//	Uart3Send(IR_DDEBase_Cmd,MyStrlen(IR_DDEBase_Cmd));

//	IR_DDE_Cmd[0] = (OsdRefresh_Family[_IR_Enhance].Data*20*2) ;//
//	IR_DDEBase_Cmd[10] = (OsdRefresh_Family[_IR_Enhance].Data*20*2 & 0xff );//基图
//	IR_DDEBase_Cmd[11] = (OsdRefresh_Family[_IR_Enhance].Data*20*2 >> 8 ) & 0xff ;//基图
//	IR_SumCheck(IR_DDE_Cmd);
//	Uart3Send(IR_DDEBase_Cmd,MyStrlen(IR_DDEBase_Cmd));

//	DecToHexToAscii(OsdRefresh_Family[_IR_Enhance].Data, 0, OsdRefresh_Family[_IR_Enhance].Module_addr, 1);
//	SmallToBig(OsdRefresh_Family[_IR_Enhance].Module_addr);
//	
//	//降噪
//	OsdRefresh_Family[_IR_DNR].Data -= Default_IR_DNR;

//	IR_DNR_Cmd[10] = OsdRefresh_Family[_IR_DNR].Data * 2;
//	IR_SumCheck(IR_Contract_Cmd);
//	Uart3Send(IR_DNR_Cmd,MyStrlen(IR_DNR_Cmd));
//	DecToHexToAscii(OsdRefresh_Family[_IR_DNR].Data, 0, OsdRefresh_Family[_IR_DNR].Module_addr, 1);
//	SmallToBig(OsdRefresh_Family[_IR_DNR].Module_addr);
//	
//	//录像拍照
//	OsdRefresh_Family[_VL_PR].Data = Default_VL_PR;
//	OsdRun_Mode = _PROFF;
//	Set_Osd_PhotoRecord(OsdRun_Mode);
//	
//	//Wifi
//	OsdRefresh_Family[_VL_Wifi].Data = Default_VL_Wifi;
//	WIFI_Mode = _WIFI_OFF;
//	Set_Osd_Wifi(WIFI_Mode);
//}


//void Init_OsdRefresh_Family(OsdRefresh_Struct *_OsdRefresh_Family)
//{
//	/*一级菜单*/
//	//状态
//	_OsdRefresh_Family[_State].Refresh_Flag = Refresh_yes;
//	_OsdRefresh_Family[_State].Module_Property = 0xD0;  // D7..D5 - 属性; D4 --- CA[8]
//	MyArrayCopy(State_Module_local,_OsdRefresh_Family[_State].Module_local);
//	MyArrayCopy(State_Module_addr,_OsdRefresh_Family[_State].Module_addr);

//	//放大
//	_OsdRefresh_Family[_AmplifierReduce].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_AmplifierReduce].Module_Property = 0xD0;
//	MyArrayCopy(_AmplifierReduce_Module_local,_OsdRefresh_Family[_AmplifierReduce].Module_local);
//	MyArrayCopy(_AmplifierReduce_Module_addr,_OsdRefresh_Family[_AmplifierReduce].Module_addr);
//	
////	//缩小
////	_OsdRefresh_Family[_Reduce].Refresh_Flag = Refresh_no;
////	_OsdRefresh_Family[_Reduce].Module_Property = 0xD0;
////	MyArrayCopy(Reduce_Module_local,_OsdRefresh_Family[_Reduce].Module_local);
////	//MyArrayCopy(Reduce_Module_addr,_OsdRefresh_Family[_Reduce].Module_addr);
//	
//	//Wify
//	_OsdRefresh_Family[_Wifi].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_Wifi].Module_Property = 0xD0;
//	MyArrayCopy(Wify_Module_local,_OsdRefresh_Family[_Wifi].Module_local);
//	MyArrayCopy(Wify_Module_addr,_OsdRefresh_Family[_Wifi].Module_addr);

//	//拍照/录像
//	_OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_PhotoRecord].Module_Property = 0xD0;
//	MyArrayCopy(PhotoRecord_Module_local,_OsdRefresh_Family[_PhotoRecord].Module_local);
//	MyArrayCopy(PhotoRecord_Module_addr,_OsdRefresh_Family[_PhotoRecord].Module_addr);
//	
////	//录像
////	_OsdRefresh_Family[_Record].Refresh_Flag = Refresh_no;
////	_OsdRefresh_Family[_Record].Module_Property = 0xD0;
////	MyArrayCopy(Record_Module_local,_OsdRefresh_Family[_Record].Module_local);
//	
//	//电量
//	_OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
//	_OsdRefresh_Family[_Power].Module_Property = 0xD0;
//	MyArrayCopy(Power_Module_local,_OsdRefresh_Family[_Power].Module_local);
//	MyArrayCopy(Power_Module_addr,_OsdRefresh_Family[_Power].Module_addr);

//	//卫星状态值
//	_OsdRefresh_Family[_Satellite].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_Satellite].Module_Property = 0xD0;
////	MyArrayCopy(Satellite_Module_local,_OsdRefresh_Family[_Satellite].Module_local);
////	MyArrayCopy(Satellite_Module_addr,_OsdRefresh_Family[_Satellite].Module_addr);
//	MyArrayCopy_LEN(Satellite_Module_local,_OsdRefresh_Family[_Satellite].Module_local,4);
//	MyArrayCopy_LEN(Satellite_Module_addr,_OsdRefresh_Family[_Satellite].Module_addr,4);
//	
//	//卫星状态
//	_OsdRefresh_Family[_Numllite].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_Numllite].Module_Property = 0xD0;
//	MyArrayCopy_LEN(Numllite_Module_local,_OsdRefresh_Family[_Numllite].Module_local,4);
//	MyArrayCopy_LEN(Numllite_Module_addr,_OsdRefresh_Family[_Numllite].Module_addr,4);
//	
//	//海拔
//	_OsdRefresh_Family[_Altitude].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_Altitude].Module_Property = 0xD0;
//	//MyArrayCopy(Altitude_Module_local,_OsdRefresh_Family[_Altitude].Module_local);
//	MyArrayCopy_LEN(Altitude_Module_local,_OsdRefresh_Family[_Altitude].Module_local,10);
//	//MyArrayCopy(Altitude_Module_addr,_OsdRefresh_Family[_Altitude].Module_addr);
//	
//	//经度标识
//	_OsdRefresh_Family[_LongitudeFlag].Refresh_Flag = Refresh_yes;
//	_OsdRefresh_Family[_LongitudeFlag].Module_Property = 0xD0;
//	MyArrayCopy(LongitudeFlag_Module_local,_OsdRefresh_Family[_LongitudeFlag].Module_local);
//	//MyArrayCopy(LongitudeFlag_Module_addr,_OsdRefresh_Family[_LongitudeFlag].Module_addr);
//	
//	//经度值
//	_OsdRefresh_Family[_Longitude].Refresh_Flag = Refresh_yes;
//	_OsdRefresh_Family[_Longitude].Module_Property = 0xD0;
//	MyArrayCopy(Longitude_Module_local,_OsdRefresh_Family[_Longitude].Module_local);
//	//MyArrayCopy(Longitude_Module_addr,_OsdRefresh_Family[_Longitude].Module_addr);
//	
//	//纬度标识
//	_OsdRefresh_Family[_LatitudeFlag].Refresh_Flag = Refresh_yes;
//	_OsdRefresh_Family[_LatitudeFlag].Module_Property = 0xD0;
//	MyArrayCopy(LatitudeFlag_Module_local,_OsdRefresh_Family[_LatitudeFlag].Module_local);
//	//MyArrayCopy(LatitudeFlag_Module_local,_OsdRefresh_Family[_LatitudeFlag].Module_addr);
//	
//	//纬度
//	_OsdRefresh_Family[_Latitude].Refresh_Flag = Refresh_yes;
//	_OsdRefresh_Family[_Latitude].Module_Property = 0xD0;
//	MyArrayCopy(Latitude_Module_local,_OsdRefresh_Family[_Latitude].Module_local);
//	//MyArrayCopy(Latitude_Module_addr,_OsdRefresh_Family[_Latitude].Module_addr);

////	//GPS
////	_OsdRefresh_Family[_Gps].Refresh_Flag = Refresh_no;
////	_OsdRefresh_Family[_Gps].Module_Property = 0xD0;
////	MyArrayCopy(Gps_Module_local,_OsdRefresh_Family[_Gps].Module_local);
////	//MyArrayCopy(Gps_Module_addr,_OsdRefresh_Family[_Gps].Module_addr);
//	
//	//红外测距
//	_OsdRefresh_Family[_Distance].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_Distance].Module_Property = 0xD0;
//	MyArrayCopy_LEN(Distance_Module_local,_OsdRefresh_Family[_Distance].Module_local,10);
//	MyArrayCopy_LEN(Distance_Module_addr,_OsdRefresh_Family[_Distance].Module_addr,10);
//	
//	//激光图标
//	_OsdRefresh_Family[_LaserFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_LaserFlag].Module_Property = 0xD0;
//	MyArrayCopy(LaserFlag_Module_local,_OsdRefresh_Family[_LaserFlag].Module_local);
//	MyArrayCopy(LaserFlag_Module_addr,_OsdRefresh_Family[_LaserFlag].Module_addr);

//	//方位
//	_OsdRefresh_Family[_Position].Refresh_Flag = Refresh_yes;
//	_OsdRefresh_Family[_Position].Module_Property = 0xD0;
//	MyArrayCopy(Position_Module_local,_OsdRefresh_Family[_Position].Module_local);
//	MyArrayCopy(Position_Module_addr,_OsdRefresh_Family[_Position].Module_addr);
//	
//	//俯仰
//	_OsdRefresh_Family[_Pitch].Refresh_Flag = Refresh_yes;
//	_OsdRefresh_Family[_Pitch].Module_Property = 0xD0;
//	MyArrayCopy(Pitch_Module_local,_OsdRefresh_Family[_Pitch].Module_local);
//	MyArrayCopy(Pitch_Module_addr,_OsdRefresh_Family[_Pitch].Module_addr); 
//	
//	//电机正反转图标
//	_OsdRefresh_Family[_ForwardReverse].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_ForwardReverse].Module_Property = 0xD0;
//	MyArrayCopy(ForwardReverse_Module_local,_OsdRefresh_Family[_ForwardReverse].Module_local);
//	MyArrayCopy(ForwardReverse_Module_addr,_OsdRefresh_Family[_ForwardReverse].Module_addr);
//	
//	//白光颜色模式
//	_OsdRefresh_Family[_Daylight_ColorMode].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_Daylight_ColorMode].Module_Property = 0xD0;
//	MyArrayCopy(Daylight_ColorMode_Module_local,_OsdRefresh_Family[_Daylight_ColorMode].Module_local);
//	MyArrayCopy(Daylight_ColorMode_Module_addr,_OsdRefresh_Family[_Daylight_ColorMode].Module_addr);
//	
//	//红外颜色模式
//	_OsdRefresh_Family[_Infrared_ColorMode].Refresh_Flag = Refresh_yes;
//	_OsdRefresh_Family[_Infrared_ColorMode].Module_Property = 0xD0;
//	MyArrayCopy(Infrared_ColorMode_Module_local,_OsdRefresh_Family[_Infrared_ColorMode].Module_local);
//	MyArrayCopy(Infrared_ColorMode_Module_addr,_OsdRefresh_Family[_Infrared_ColorMode].Module_addr);
//	
//	//描线
//	_OsdRefresh_Family[_AimLine].Refresh_Flag = Refresh_yes;
//	_OsdRefresh_Family[_AimLine].Module_Property = 0xD0;
//	MyArrayCopy(Aim_line_local,_OsdRefresh_Family[_AimLine].Module_local);
//	MyArrayCopy(Aim_line_addr,_OsdRefresh_Family[_AimLine].Module_addr);
//	
//	//Loading
//	_OsdRefresh_Family[_Loading].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_Loading].Module_Property = 0xD0;
//	MyArrayCopy_LEN(Loading_Module_local,_OsdRefresh_Family[_Loading].Module_local,20);
//	MyArrayCopy_LEN(Loading_Module_addr,_OsdRefresh_Family[_Loading].Module_addr,20);
//	
//	//红外电子变倍
//	_OsdRefresh_Family[_IR_Zoom].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_Zoom].Module_Property = 0xD0;
//	MyArrayCopy(Infrared_Zoom_Module_local,_OsdRefresh_Family[_IR_Zoom].Module_local);
//	MyArrayCopy(Infrared_Zoom_Module_addr,_OsdRefresh_Family[_IR_Zoom].Module_addr);
//	_OsdRefresh_Family[_IR_Zoom].Data = 0;
//	/********************二级菜单*************************/
//	////红外模式配置界面
//	//亮度标识
//	_OsdRefresh_Family[_IR_BrightnessFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_BrightnessFlag].Module_Property = 0xD0;
//	MyArrayCopy(IR_BrightnessFlag_Module_local,_OsdRefresh_Family[_IR_BrightnessFlag].Module_local);
//	MyArrayCopy(IR_BrightnessFlag_Module_addr,_OsdRefresh_Family[_IR_BrightnessFlag].Module_addr);
//	//亮度值
//	_OsdRefresh_Family[_IR_Brightness].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_Brightness].Module_Property = 0xD0;
//	MyArrayCopy(IR_Brightness_Module_local,_OsdRefresh_Family[_IR_Brightness].Module_local);
//	MyArrayCopy(IR_Brightness_Module_addr,_OsdRefresh_Family[_IR_Brightness].Module_addr);
//	_OsdRefresh_Family[_IR_Brightness].Data = StrTODec(_OsdRefresh_Family[_IR_Brightness].Module_addr);
//	
//	//对比度标识
//	_OsdRefresh_Family[_IR_ContrastRatioFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_ContrastRatioFlag].Module_Property = 0xD0;
//	MyArrayCopy(IR_ContrastRatioFlag_Module_local,_OsdRefresh_Family[_IR_ContrastRatioFlag].Module_local);
//	MyArrayCopy(IR_ContrastRatioFlag_Module_addr,_OsdRefresh_Family[_IR_ContrastRatioFlag].Module_addr);
//	
//	//对比度
//	_OsdRefresh_Family[_IR_ContrastRatio].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_ContrastRatio].Module_Property = 0xD0;
//	MyArrayCopy(IR_ContrastRatio_Module_local,_OsdRefresh_Family[_IR_ContrastRatio].Module_local);
//	MyArrayCopy(IR_ContrastRatio_Module_addr,_OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
//	_OsdRefresh_Family[_IR_ContrastRatio].Data = StrTODec(_OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
//	
//	//增强标识
//	_OsdRefresh_Family[_IR_EnhanceFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_EnhanceFlag].Module_Property = 0xD0;
//	MyArrayCopy(IR_EnhanceFlag_Module_local,_OsdRefresh_Family[_IR_EnhanceFlag].Module_local);
//	MyArrayCopy(IR_EnhanceFlag_Module_addr,_OsdRefresh_Family[_IR_EnhanceFlag].Module_addr);
//	
//	//增强值
//	_OsdRefresh_Family[_IR_Enhance].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_Enhance].Module_Property = 0xD0;
//	MyArrayCopy(IR_Enhance_Module_local,_OsdRefresh_Family[_IR_Enhance].Module_local);
//	MyArrayCopy(IR_Enhance_Module_addr,_OsdRefresh_Family[_IR_Enhance].Module_addr);
//	_OsdRefresh_Family[_IR_Enhance].Data = StrTODec(_OsdRefresh_Family[_IR_Enhance].Module_addr);
//	
////	//画中画标识
////	_OsdRefresh_Family[_PipFlag].Refresh_Flag = Refresh_no;
////	_OsdRefresh_Family[_PipFlag].Module_Property = 0xD0;
////	MyArrayCopy(PipFlag_Module_local,_OsdRefresh_Family[_PipFlag].Module_local);
////	MyArrayCopy(PipFlag_Module_addr,_OsdRefresh_Family[_PipFlag].Module_addr);
//	
////	//画中画值
////	_OsdRefresh_Family[_Pip].Refresh_Flag = Refresh_no;
////	_OsdRefresh_Family[_Pip].Module_Property = 0xD0;
////	MyArrayCopy(Pip_Module_local,_OsdRefresh_Family[_Pip].Module_local);
////	MyArrayCopy(Pip_Module_addr,_OsdRefresh_Family[_Pip].Module_addr);
////	_OsdRefresh_Family[_Pip].Data = 0;//关

//#if ChengDu
//	//降噪标识
//	_OsdRefresh_Family[_IR_DNRFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_DNRFlag].Module_Property = 0xD0;
//	MyArrayCopy(IR_DNRFlag_Module_local,_OsdRefresh_Family[_IR_DNRFlag].Module_local);
//	MyArrayCopy(IR_DNRFlag_Module_addr,_OsdRefresh_Family[_IR_DNRFlag].Module_addr);
//	
//	//降噪值
//	_OsdRefresh_Family[_IR_DNR].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_DNR].Module_Property = 0xD0;
//	MyArrayCopy(IR_DNR_Module_local,_OsdRefresh_Family[_IR_DNR].Module_local);
//	MyArrayCopy(IR_DNR_Module_addr,_OsdRefresh_Family[_IR_DNR].Module_addr);
//	
//#elif BT656 
//	//户外标识
//	_OsdRefresh_Family[_IR_OutDoorFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_OutDoorFlag].Module_Property = 0xD0;
//	MyArrayCopy(IR_OutDoorFlag_Module_local,_OsdRefresh_Family[_IR_OutDoorFlag].Module_local);
//	MyArrayCopy(IR_OutDoorFlag_Module_addr,_OsdRefresh_Family[_IR_OutDoorFlag].Module_addr);
//	
//	//户外值
//	_OsdRefresh_Family[_IR_OutDoor].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_OutDoor].Module_Property = 0xD0;
//	MyArrayCopy(IR_OutDoor_Module_local,_OsdRefresh_Family[_IR_OutDoor].Module_local);
//	MyArrayCopy(IR_OutDoor_Module_addr,_OsdRefresh_Family[_IR_OutDoor].Module_addr);
//	

//#endif

//	//极性标识
//	_OsdRefresh_Family[_IR_PolarFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_PolarFlag].Module_Property = 0xD0;
//	MyArrayCopy(IR_PolarFlag_Module_local,_OsdRefresh_Family[_IR_PolarFlag].Module_local);
//	MyArrayCopy(IR_PolarFlag_Module_addr,_OsdRefresh_Family[_IR_PolarFlag].Module_addr);
//	
//	//极性值
//	_OsdRefresh_Family[_IR_Polar].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_Polar].Module_Property = 0xD0;
//	MyArrayCopy(IR_Polar_Module_local,_OsdRefresh_Family[_IR_Polar].Module_local);
//	MyArrayCopy(IR_Polar_Module_addr,_OsdRefresh_Family[_IR_Polar].Module_addr);
//	_OsdRefresh_Family[_IR_Polar].Data = 0;//关
//	
//	//录像拍照标识
//	_OsdRefresh_Family[_IR_PRFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_PRFlag].Module_Property = 0xD0;
//	MyArrayCopy(IR_PRFlag_Module_local,_OsdRefresh_Family[_IR_PRFlag].Module_local);
//	MyArrayCopy(IR_PRFlag_Module_addr,_OsdRefresh_Family[_IR_PRFlag].Module_addr);
//	
//	//录像拍照值
//	_OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_PR].Module_Property = 0xD0;
//	MyArrayCopy(IR_PR_Module_local,_OsdRefresh_Family[_IR_PR].Module_local);
//	MyArrayCopy(IR_PR_Module_addr,_OsdRefresh_Family[_IR_PR].Module_addr);
//	_OsdRefresh_Family[_IR_PR].Data = 0;//关
//	
//	//Wify标识
//	_OsdRefresh_Family[_IR_WifiFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_WifiFlag].Module_Property = 0xD0;
//	MyArrayCopy(IR_WifiFlag_Module_local,_OsdRefresh_Family[_IR_WifiFlag].Module_local);
//	MyArrayCopy(IR_WifiFlag_Module_addr,_OsdRefresh_Family[_IR_WifiFlag].Module_addr);
//	
//	//Wify值
//	_OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_Wifi].Module_Property = 0xD0;
//	MyArrayCopy(IR_Wifi_Module_local,_OsdRefresh_Family[_IR_Wifi].Module_local);
//	MyArrayCopy(IR_Wifi_Module_addr,_OsdRefresh_Family[_IR_Wifi].Module_addr);
//	_OsdRefresh_Family[_IR_Wifi].Data = 0;//关
//	
//	//光标
//	_OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_Cursor].Module_Property = 0xD0;
//	MyArrayCopy(IR_Cursor_Module_local,_OsdRefresh_Family[_IR_Cursor].Module_local);
//	MyArrayCopy(IR_Cursor_Module_addr,_OsdRefresh_Family[_IR_Cursor].Module_addr);
//	
////	//退出
////	_OsdRefresh_Family[_IR_Exit].Refresh_Flag = Refresh_no;
////	_OsdRefresh_Family[_IR_Exit].Module_Property = 0xD0;
////	MyArrayCopy(IR_Exit_Module_local,_OsdRefresh_Family[_IR_Exit].Module_local);
////	MyArrayCopy(IR_Exit_Module_addr,_OsdRefresh_Family[_IR_Exit].Module_addr);

//	/**********白光*************/
//	//亮度标识
//	_OsdRefresh_Family[_VL_BrightnessFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_BrightnessFlag].Module_Property = 0xD0;
//	MyArrayCopy(VL_BrightnessFlag_Module_local,_OsdRefresh_Family[_VL_BrightnessFlag].Module_local);
//	MyArrayCopy(VL_BrightnessFlag_Module_addr,_OsdRefresh_Family[_VL_BrightnessFlag].Module_addr);
//	//亮度值
//	_OsdRefresh_Family[_VL_Brightness].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_Brightness].Module_Property = 0xD0;
//	MyArrayCopy(VL_Brightness_Module_local,_OsdRefresh_Family[_VL_Brightness].Module_local);
//	MyArrayCopy(VL_Brightness_Module_addr,_OsdRefresh_Family[_VL_Brightness].Module_addr);
//	_OsdRefresh_Family[_VL_Brightness].Data = StrTODec(_OsdRefresh_Family[_VL_Brightness].Module_addr);

//	//对比度标识
//	_OsdRefresh_Family[_VL_ContrastRatioFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_ContrastRatioFlag].Module_Property = 0xD0;
//	MyArrayCopy(VL_ContrastRatioFlag_Module_local,_OsdRefresh_Family[_VL_ContrastRatioFlag].Module_local);
//	MyArrayCopy(VL_ContrastRatioFlag_Module_addr,_OsdRefresh_Family[_VL_ContrastRatioFlag].Module_addr);
//	//对比度值
//	_OsdRefresh_Family[_VL_ContrastRatio].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_ContrastRatio].Module_Property = 0xD0;
//	MyArrayCopy(VL_ContrastRatio_Module_local,_OsdRefresh_Family[_VL_ContrastRatio].Module_local);
//	MyArrayCopy(VL_ContrastRatio_Module_addr,_OsdRefresh_Family[_VL_ContrastRatio].Module_addr);
//	_OsdRefresh_Family[_VL_ContrastRatio].Data = StrTODec(_OsdRefresh_Family[_VL_ContrastRatio].Module_addr);

//	//模式标识
//	_OsdRefresh_Family[_VL_ModeFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_ModeFlag].Module_Property = 0xD0;
//	MyArrayCopy(VL_ModeFlag_Module_local,_OsdRefresh_Family[_VL_ModeFlag].Module_local);
//	MyArrayCopy(VL_ModeFlag_Module_addr,_OsdRefresh_Family[_VL_ModeFlag].Module_addr);
//	//模式度值
//	_OsdRefresh_Family[_VL_Mode].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_Mode].Module_Property = 0xD0;
//	MyArrayCopy(VL_Mode_Module_local,_OsdRefresh_Family[_VL_Mode].Module_local);
//	MyArrayCopy(VL_Mode_Module_addr,_OsdRefresh_Family[_VL_Mode].Module_addr);
//	_OsdRefresh_Family[_VL_Mode].Data = StrTODec(_OsdRefresh_Family[_VL_Mode].Module_addr);
//	
//	//动态范围标识
//	_OsdRefresh_Family[_VL_DWDRFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_DWDRFlag].Module_Property = 0xD0;
//	MyArrayCopy(VL_DWDRFlag_Module_local,_OsdRefresh_Family[_VL_DWDRFlag].Module_local);
//	MyArrayCopy(VL_DWDRFlag_Module_addr,_OsdRefresh_Family[_VL_DWDRFlag].Module_addr);
//	//动态范围度值
//	_OsdRefresh_Family[_VL_DWDR].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_DWDR].Module_Property = 0xD0;
//	MyArrayCopy(VL_DWDR_Module_local,_OsdRefresh_Family[_VL_DWDR].Module_local);
//	MyArrayCopy(VL_DWDR_Module_addr,_OsdRefresh_Family[_VL_DWDR].Module_addr);
//	_OsdRefresh_Family[_VL_DWDR].Data = StrTODec(_OsdRefresh_Family[_VL_DWDR].Module_addr);
//	
//	//降噪标识
//	_OsdRefresh_Family[_VL_DNRFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_DNRFlag].Module_Property = 0xD0;
//	MyArrayCopy(VL_DNRFlag_Module_local,_OsdRefresh_Family[_VL_DNRFlag].Module_local);
//	MyArrayCopy(VL_DNRFlag_Module_addr,_OsdRefresh_Family[_VL_DNRFlag].Module_addr);
//	//降噪值
//#if VL_MC_105Q

//	_OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_DNR].Module_Property = 0xD0;
//	MyArrayCopy(VL_DNR_Module_local,_OsdRefresh_Family[_VL_DNR].Module_local);
//	MyArrayCopy(VL_DNR_Module_addr,_OsdRefresh_Family[_VL_DNR].Module_addr);
//	_OsdRefresh_Family[_VL_DNR].Data = StrTODec(_OsdRefresh_Family[_VL_DNR].Module_addr);
//#elif VL_YT_3578_HD
//	_OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_DNR].Module_Property = 0xD0;
//	MyArrayCopy(VL_DNR_Module_local,_OsdRefresh_Family[_VL_DNR].Module_local);
//	MyArrayCopy(VL_DNR_Module_addr,_OsdRefresh_Family[_VL_DNR].Module_addr);
//#endif
//	//录像标识
//	_OsdRefresh_Family[_VL_PRFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_PRFlag].Module_Property = 0xD0;
//	MyArrayCopy(VL_PRFlag_Module_local,_OsdRefresh_Family[_VL_PRFlag].Module_local);
//	MyArrayCopy(VL_PRFlag_Module_addr,_OsdRefresh_Family[_VL_PRFlag].Module_addr);
//	//录像值
//	_OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_PR].Module_Property = 0xD0;
//	MyArrayCopy(VL_PR_Module_local,_OsdRefresh_Family[_VL_PR].Module_local);
//	MyArrayCopy(VL_PR_Module_addr,_OsdRefresh_Family[_VL_PR].Module_addr);
//	_OsdRefresh_Family[_VL_PR].Data = StrTODec(_OsdRefresh_Family[_VL_PR].Module_addr);
//	
//	//Wifi标识
//	_OsdRefresh_Family[_VL_WifiFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_WifiFlag].Module_Property = 0xD0;
//	MyArrayCopy(VL_WifiFlag_Module_local,_OsdRefresh_Family[_VL_WifiFlag].Module_local);
//	MyArrayCopy(VL_WifiFlag_Module_addr,_OsdRefresh_Family[_VL_WifiFlag].Module_addr);
//	//Wifi值
//	_OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_Wifi].Module_Property = 0xD0;
//	MyArrayCopy(VL_Wifi_Module_local,_OsdRefresh_Family[_VL_Wifi].Module_local);
//	MyArrayCopy(VL_Wifi_Module_addr,_OsdRefresh_Family[_VL_Wifi].Module_addr);
//	_OsdRefresh_Family[_VL_Wifi].Data = StrTODec(_OsdRefresh_Family[_VL_Wifi].Module_addr);
//	
////	//退出标识
////	_OsdRefresh_Family[_VL_Exit].Refresh_Flag = Refresh_no;
////	_OsdRefresh_Family[_VL_Exit].Module_Property = 0xD0;
////	MyArrayCopy(VL_Exit_Module_local,_OsdRefresh_Family[_VL_Exit].Module_local);
////	MyArrayCopy(VL_Exit_Module_addr,_OsdRefresh_Family[_VL_Exit].Module_addr);
//	
//	//光标值
//	_OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_Cursor].Module_Property = 0xD0;
//	MyArrayCopy(VL_Cursor_Module_local,_OsdRefresh_Family[_VL_Cursor].Module_local);
//	MyArrayCopy(VL_Cursor_Module_addr,_OsdRefresh_Family[_VL_Cursor].Module_addr);
//	_OsdRefresh_Family[_VL_Cursor].Data = StrTODec(_OsdRefresh_Family[_VL_Cursor].Module_addr);
//}
void Init_OsdRefresh_Family(OsdRefresh_Struct *_OsdRefresh_Family)
{
	/*一级菜单*/
	//状态
	_OsdRefresh_Family[_State].Refresh_Flag = Refresh_yes;
	_OsdRefresh_Family[_State].Module_Property = 0xD0;  // D7..D5 - 属性; D4 --- CA[8]
	MyArrayCopy(State_Module_local,_OsdRefresh_Family[_State].Module_local);
	MyArrayCopy(State_Module_addr,_OsdRefresh_Family[_State].Module_addr);

	//放大
	_OsdRefresh_Family[_VL_Zoom].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_Zoom].Module_Property = 0xD0;
	MyArrayCopy(Daylight_Zoom_Module_local,_OsdRefresh_Family[_VL_Zoom].Module_local);
	MyArrayCopy(Daylight_Zoom_Module_addr,_OsdRefresh_Family[_VL_Zoom].Module_addr);
	
	//红外电子变倍
	_OsdRefresh_Family[_IR_Zoom].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_Zoom].Module_Property = 0xD0;
	MyArrayCopy(Infrared_Zoom_Module_local,_OsdRefresh_Family[_IR_Zoom].Module_local);
	MyArrayCopy(Infrared_Zoom_Module_addr,_OsdRefresh_Family[_IR_Zoom].Module_addr);
	//_OsdRefresh_Family[_IR_Zoom].Data = 1;
	
//	//缩小
//	_OsdRefresh_Family[_Reduce].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_Reduce].Module_Property = 0xD0;
//	MyArrayCopy(Reduce_Module_local,_OsdRefresh_Family[_Reduce].Module_local);
//	//MyArrayCopy(Reduce_Module_addr,_OsdRefresh_Family[_Reduce].Module_addr);
	

#if WiFi_Flag	
	//Wify
	_OsdRefresh_Family[_Wifi].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_Wifi].Module_Property = 0xD0;
	MyArrayCopy(Wify_Module_local,_OsdRefresh_Family[_Wifi].Module_local);
	MyArrayCopy(Wify_Module_addr,_OsdRefresh_Family[_Wifi].Module_addr);
#endif

	//拍照/录像
	_OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_PhotoRecord].Module_Property = 0xD0;
	MyArrayCopy(PhotoRecord_Module_local,_OsdRefresh_Family[_PhotoRecord].Module_local);
	MyArrayCopy(PhotoRecord_Module_addr,_OsdRefresh_Family[_PhotoRecord].Module_addr);
	
//	//录像
//	_OsdRefresh_Family[_Record].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_Record].Module_Property = 0xD0;
//	MyArrayCopy(Record_Module_local,_OsdRefresh_Family[_Record].Module_local);
	
	//电量
	_OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
	_OsdRefresh_Family[_Power].Module_Property = 0xD0;
	MyArrayCopy(Power_Module_local,_OsdRefresh_Family[_Power].Module_local);
	MyArrayCopy(Power_Module_addr,_OsdRefresh_Family[_Power].Module_addr);

	//卫星状态值
	_OsdRefresh_Family[_Satellite].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_Satellite].Module_Property = 0xD0;
//	MyArrayCopy(Satellite_Module_local,_OsdRefresh_Family[_Satellite].Module_local);
//	MyArrayCopy(Satellite_Module_addr,_OsdRefresh_Family[_Satellite].Module_addr);
	MyArrayCopy_LEN(Satellite_Module_local,_OsdRefresh_Family[_Satellite].Module_local,4);
	MyArrayCopy_LEN(Satellite_Module_addr,_OsdRefresh_Family[_Satellite].Module_addr,4);
	
	//卫星状态
	_OsdRefresh_Family[_Numllite].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_Numllite].Module_Property = 0xD0;
	MyArrayCopy_LEN(Numllite_Module_local,_OsdRefresh_Family[_Numllite].Module_local,4);
	MyArrayCopy_LEN(Numllite_Module_addr,_OsdRefresh_Family[_Numllite].Module_addr,4);
	
	//海拔
	_OsdRefresh_Family[_Altitude].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_Altitude].Module_Property = 0xD0;
	//MyArrayCopy(Altitude_Module_local,_OsdRefresh_Family[_Altitude].Module_local);
	MyArrayCopy_LEN(Altitude_Module_local,_OsdRefresh_Family[_Altitude].Module_local,10);
	//MyArrayCopy(Altitude_Module_addr,_OsdRefresh_Family[_Altitude].Module_addr);
	
	//经度标识
	_OsdRefresh_Family[_LongitudeFlag].Refresh_Flag = Refresh_yes;
	_OsdRefresh_Family[_LongitudeFlag].Module_Property = 0xD0;
	MyArrayCopy(LongitudeFlag_Module_local,_OsdRefresh_Family[_LongitudeFlag].Module_local);
	//MyArrayCopy(LongitudeFlag_Module_addr,_OsdRefresh_Family[_LongitudeFlag].Module_addr);
	
	//经度值
	_OsdRefresh_Family[_Longitude].Refresh_Flag = Refresh_yes;
	_OsdRefresh_Family[_Longitude].Module_Property = 0xD0;
	MyArrayCopy(Longitude_Module_local,_OsdRefresh_Family[_Longitude].Module_local);
	//MyArrayCopy(Longitude_Module_addr,_OsdRefresh_Family[_Longitude].Module_addr);
	
	//纬度标识
	_OsdRefresh_Family[_LatitudeFlag].Refresh_Flag = Refresh_yes;
	_OsdRefresh_Family[_LatitudeFlag].Module_Property = 0xD0;
	MyArrayCopy(LatitudeFlag_Module_local,_OsdRefresh_Family[_LatitudeFlag].Module_local);
	//MyArrayCopy(LatitudeFlag_Module_local,_OsdRefresh_Family[_LatitudeFlag].Module_addr);
	
	//纬度
	_OsdRefresh_Family[_Latitude].Refresh_Flag = Refresh_yes;
	_OsdRefresh_Family[_Latitude].Module_Property = 0xD0;
	MyArrayCopy(Latitude_Module_local,_OsdRefresh_Family[_Latitude].Module_local);
	//MyArrayCopy(Latitude_Module_addr,_OsdRefresh_Family[_Latitude].Module_addr);

//	//GPS
//	_OsdRefresh_Family[_Gps].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_Gps].Module_Property = 0xD0;
//	MyArrayCopy(Gps_Module_local,_OsdRefresh_Family[_Gps].Module_local);
//	//MyArrayCopy(Gps_Module_addr,_OsdRefresh_Family[_Gps].Module_addr);
	
	//红外测距
	_OsdRefresh_Family[_Distance].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_Distance].Module_Property = 0xD0;
	MyArrayCopy_LEN(Distance_Module_local,_OsdRefresh_Family[_Distance].Module_local,10);
	MyArrayCopy_LEN(Distance_Module_addr,_OsdRefresh_Family[_Distance].Module_addr,10);
	
	//激光图标
	_OsdRefresh_Family[_LaserFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_LaserFlag].Module_Property = 0xD0;
	MyArrayCopy(LaserFlag_Module_local,_OsdRefresh_Family[_LaserFlag].Module_local);
	MyArrayCopy(LaserFlag_Module_addr,_OsdRefresh_Family[_LaserFlag].Module_addr);

	//方位
	_OsdRefresh_Family[_Position].Refresh_Flag = Refresh_yes;
	_OsdRefresh_Family[_Position].Module_Property = 0xD0;
	MyArrayCopy(Position_Module_local,_OsdRefresh_Family[_Position].Module_local);
	MyArrayCopy(Position_Module_addr,_OsdRefresh_Family[_Position].Module_addr);
	
	//俯仰
	_OsdRefresh_Family[_Pitch].Refresh_Flag = Refresh_yes;
	_OsdRefresh_Family[_Pitch].Module_Property = 0xD0;
	MyArrayCopy(Pitch_Module_local,_OsdRefresh_Family[_Pitch].Module_local);
	MyArrayCopy(Pitch_Module_addr,_OsdRefresh_Family[_Pitch].Module_addr); 
	
	//电机正反转图标
	_OsdRefresh_Family[_ForwardReverse].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_ForwardReverse].Module_Property = 0xD0;
	MyArrayCopy(ForwardReverse_Module_local,_OsdRefresh_Family[_ForwardReverse].Module_local);
	MyArrayCopy(ForwardReverse_Module_addr,_OsdRefresh_Family[_ForwardReverse].Module_addr);
#if Frist_VL	
	//白光颜色模式
	_OsdRefresh_Family[_Daylight_ColorMode].Refresh_Flag = Refresh_yes;
	_OsdRefresh_Family[_Daylight_ColorMode].Module_Property = 0xD0;
	MyArrayCopy(Daylight_ColorMode_Module_local,_OsdRefresh_Family[_Daylight_ColorMode].Module_local);
	MyArrayCopy(Daylight_ColorMode_Module_addr,_OsdRefresh_Family[_Daylight_ColorMode].Module_addr);
	
	//红外颜色模式
	_OsdRefresh_Family[_Infrared_ColorMode].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_Infrared_ColorMode].Module_Property = 0xD0;
	MyArrayCopy(Infrared_ColorMode_Module_local,_OsdRefresh_Family[_Infrared_ColorMode].Module_local);
	MyArrayCopy(Infrared_ColorMode_Module_addr,_OsdRefresh_Family[_Infrared_ColorMode].Module_addr);
#elif Frist_IR
	//白光颜色模式
	_OsdRefresh_Family[_Daylight_ColorMode].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_Daylight_ColorMode].Module_Property = 0xD0;
	MyArrayCopy(Daylight_ColorMode_Module_local,_OsdRefresh_Family[_Daylight_ColorMode].Module_local);
	MyArrayCopy(Daylight_ColorMode_Module_addr,_OsdRefresh_Family[_Daylight_ColorMode].Module_addr);
	
	//红外颜色模式
	_OsdRefresh_Family[_Infrared_ColorMode].Refresh_Flag = Refresh_yes;
	_OsdRefresh_Family[_Infrared_ColorMode].Module_Property = 0xD0;
	MyArrayCopy(Infrared_ColorMode_Module_local,_OsdRefresh_Family[_Infrared_ColorMode].Module_local);
	MyArrayCopy(Infrared_ColorMode_Module_addr,_OsdRefresh_Family[_Infrared_ColorMode].Module_addr);
#endif

	//描线
	_OsdRefresh_Family[_AimLine].Refresh_Flag = Refresh_yes;
	_OsdRefresh_Family[_AimLine].Module_Property = 0xD0;
	MyArrayCopy(Aim_line_local,_OsdRefresh_Family[_AimLine].Module_local);
	MyArrayCopy(Aim_line_addr,_OsdRefresh_Family[_AimLine].Module_addr);
	
	//Loading
	_OsdRefresh_Family[_Loading].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_Loading].Module_Property = 0xD0;
	MyArrayCopy_LEN(Loading_Module_local,_OsdRefresh_Family[_Loading].Module_local,20);
	MyArrayCopy_LEN(Loading_Module_addr,_OsdRefresh_Family[_Loading].Module_addr,20);
	

	/********************二级菜单*************************/
	////红外模式配置界面
	//亮度标识
	_OsdRefresh_Family[_IR_BrightnessFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_BrightnessFlag].Module_Property = 0xD0;
	MyArrayCopy(IR_BrightnessFlag_Module_local,_OsdRefresh_Family[_IR_BrightnessFlag].Module_local);
	MyArrayCopy(IR_BrightnessFlag_Module_addr,_OsdRefresh_Family[_IR_BrightnessFlag].Module_addr);
	//亮度值
	_OsdRefresh_Family[_IR_Brightness].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_Brightness].Module_Property = 0xD0;
	MyArrayCopy(IR_Brightness_Module_local,_OsdRefresh_Family[_IR_Brightness].Module_local);
	MyArrayCopy(IR_Brightness_Module_addr,_OsdRefresh_Family[_IR_Brightness].Module_addr);
	_OsdRefresh_Family[_IR_Brightness].Data = StrTODec(_OsdRefresh_Family[_IR_Brightness].Module_addr);
	
	//对比度标识
	_OsdRefresh_Family[_IR_ContrastRatioFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_ContrastRatioFlag].Module_Property = 0xD0;
	MyArrayCopy(IR_ContrastRatioFlag_Module_local,_OsdRefresh_Family[_IR_ContrastRatioFlag].Module_local);
	MyArrayCopy(IR_ContrastRatioFlag_Module_addr,_OsdRefresh_Family[_IR_ContrastRatioFlag].Module_addr);
	
	//对比度
	_OsdRefresh_Family[_IR_ContrastRatio].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_ContrastRatio].Module_Property = 0xD0;
	MyArrayCopy(IR_ContrastRatio_Module_local,_OsdRefresh_Family[_IR_ContrastRatio].Module_local);
	MyArrayCopy(IR_ContrastRatio_Module_addr,_OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
	_OsdRefresh_Family[_IR_ContrastRatio].Data = StrTODec(_OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
	
	//增强标识
	_OsdRefresh_Family[_IR_EnhanceFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_EnhanceFlag].Module_Property = 0xD0;
	MyArrayCopy(IR_EnhanceFlag_Module_local,_OsdRefresh_Family[_IR_EnhanceFlag].Module_local);
	MyArrayCopy(IR_EnhanceFlag_Module_addr,_OsdRefresh_Family[_IR_EnhanceFlag].Module_addr);
	
	//增强值
	_OsdRefresh_Family[_IR_Enhance].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_Enhance].Module_Property = 0xD0;
	MyArrayCopy(IR_Enhance_Module_local,_OsdRefresh_Family[_IR_Enhance].Module_local);
	MyArrayCopy(IR_Enhance_Module_addr,_OsdRefresh_Family[_IR_Enhance].Module_addr);
	_OsdRefresh_Family[_IR_Enhance].Data = StrTODec(_OsdRefresh_Family[_IR_Enhance].Module_addr);
	
//	//画中画标识
//	_OsdRefresh_Family[_PipFlag].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_PipFlag].Module_Property = 0xD0;
//	MyArrayCopy(PipFlag_Module_local,_OsdRefresh_Family[_PipFlag].Module_local);
//	MyArrayCopy(PipFlag_Module_addr,_OsdRefresh_Family[_PipFlag].Module_addr);
	
//	//画中画值
//	_OsdRefresh_Family[_Pip].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_Pip].Module_Property = 0xD0;
//	MyArrayCopy(Pip_Module_local,_OsdRefresh_Family[_Pip].Module_local);
//	MyArrayCopy(Pip_Module_addr,_OsdRefresh_Family[_Pip].Module_addr);
//	_OsdRefresh_Family[_Pip].Data = 0;//关

#if ChengDu
	//降噪标识
	_OsdRefresh_Family[_IR_DNRFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_DNRFlag].Module_Property = 0xD0;
	MyArrayCopy(IR_DNRFlag_Module_local,_OsdRefresh_Family[_IR_DNRFlag].Module_local);
	MyArrayCopy(IR_DNRFlag_Module_addr,_OsdRefresh_Family[_IR_DNRFlag].Module_addr);
	
	//降噪值
	_OsdRefresh_Family[_IR_DNR].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_DNR].Module_Property = 0xD0;
	MyArrayCopy(IR_DNR_Module_local,_OsdRefresh_Family[_IR_DNR].Module_local);
	MyArrayCopy(IR_DNR_Module_addr,_OsdRefresh_Family[_IR_DNR].Module_addr);
	
#elif BT656 
	//户外标识
	_OsdRefresh_Family[_IR_OutDoorFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_OutDoorFlag].Module_Property = 0xD0;
	MyArrayCopy(IR_OutDoorFlag_Module_local,_OsdRefresh_Family[_IR_OutDoorFlag].Module_local);
	MyArrayCopy(IR_OutDoorFlag_Module_addr,_OsdRefresh_Family[_IR_OutDoorFlag].Module_addr);
	
	//户外值
	_OsdRefresh_Family[_IR_OutDoor].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_OutDoor].Module_Property = 0xD0;
	MyArrayCopy(IR_OutDoor_Module_local,_OsdRefresh_Family[_IR_OutDoor].Module_local);
	MyArrayCopy(IR_OutDoor_Module_addr,_OsdRefresh_Family[_IR_OutDoor].Module_addr);
	

#endif

	//极性标识
	_OsdRefresh_Family[_IR_PolarFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_PolarFlag].Module_Property = 0xD0;
	MyArrayCopy(IR_PolarFlag_Module_local,_OsdRefresh_Family[_IR_PolarFlag].Module_local);
	MyArrayCopy(IR_PolarFlag_Module_addr,_OsdRefresh_Family[_IR_PolarFlag].Module_addr);
	
	//极性值
	_OsdRefresh_Family[_IR_Polar].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_Polar].Module_Property = 0xD0;
	MyArrayCopy(IR_Polar_Module_local,_OsdRefresh_Family[_IR_Polar].Module_local);
	MyArrayCopy(IR_Polar_Module_addr,_OsdRefresh_Family[_IR_Polar].Module_addr);
	_OsdRefresh_Family[_IR_Polar].Data = 0;//关
	
	//录像拍照标识
	_OsdRefresh_Family[_IR_PRFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_PRFlag].Module_Property = 0xD0;
	MyArrayCopy(IR_PRFlag_Module_local,_OsdRefresh_Family[_IR_PRFlag].Module_local);
	MyArrayCopy(IR_PRFlag_Module_addr,_OsdRefresh_Family[_IR_PRFlag].Module_addr);
	
	//录像拍照值
	_OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_PR].Module_Property = 0xD0;
	MyArrayCopy(IR_PR_Module_local,_OsdRefresh_Family[_IR_PR].Module_local);
	MyArrayCopy(IR_PR_Module_addr,_OsdRefresh_Family[_IR_PR].Module_addr);
	_OsdRefresh_Family[_IR_PR].Data = 0;//关
	
#if WiFi_Flag	
	
	//Wify标识
	_OsdRefresh_Family[_IR_WifiFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_WifiFlag].Module_Property = 0xD0;
	MyArrayCopy(IR_WifiFlag_Module_local,_OsdRefresh_Family[_IR_WifiFlag].Module_local);
	MyArrayCopy(IR_WifiFlag_Module_addr,_OsdRefresh_Family[_IR_WifiFlag].Module_addr);
	
	//Wify值
	_OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_Wifi].Module_Property = 0xD0;
	MyArrayCopy(IR_Wifi_Module_local,_OsdRefresh_Family[_IR_Wifi].Module_local);
	MyArrayCopy(IR_Wifi_Module_addr,_OsdRefresh_Family[_IR_Wifi].Module_addr);
	_OsdRefresh_Family[_IR_Wifi].Data = 0;//关
	
#endif	
	//光标
	_OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_IR_Cursor].Module_Property = 0xD0;
	MyArrayCopy(IR_Cursor_Module_local,_OsdRefresh_Family[_IR_Cursor].Module_local);
	MyArrayCopy(IR_Cursor_Module_addr,_OsdRefresh_Family[_IR_Cursor].Module_addr);
	
//	//退出
//	_OsdRefresh_Family[_IR_Exit].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_IR_Exit].Module_Property = 0xD0;
//	MyArrayCopy(IR_Exit_Module_local,_OsdRefresh_Family[_IR_Exit].Module_local);
//	MyArrayCopy(IR_Exit_Module_addr,_OsdRefresh_Family[_IR_Exit].Module_addr);

	/**********白光*************/
	//亮度标识
	_OsdRefresh_Family[_VL_BrightnessFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_BrightnessFlag].Module_Property = 0xD0;
	MyArrayCopy(VL_BrightnessFlag_Module_local,_OsdRefresh_Family[_VL_BrightnessFlag].Module_local);
	MyArrayCopy(VL_BrightnessFlag_Module_addr,_OsdRefresh_Family[_VL_BrightnessFlag].Module_addr);
	//亮度值
	_OsdRefresh_Family[_VL_Brightness].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_Brightness].Module_Property = 0xD0;
	MyArrayCopy(VL_Brightness_Module_local,_OsdRefresh_Family[_VL_Brightness].Module_local);
	MyArrayCopy(VL_Brightness_Module_addr,_OsdRefresh_Family[_VL_Brightness].Module_addr);
	_OsdRefresh_Family[_VL_Brightness].Data = StrTODec(_OsdRefresh_Family[_VL_Brightness].Module_addr);

	//对比度标识
	_OsdRefresh_Family[_VL_ContrastRatioFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_ContrastRatioFlag].Module_Property = 0xD0;
	MyArrayCopy(VL_ContrastRatioFlag_Module_local,_OsdRefresh_Family[_VL_ContrastRatioFlag].Module_local);
	MyArrayCopy(VL_ContrastRatioFlag_Module_addr,_OsdRefresh_Family[_VL_ContrastRatioFlag].Module_addr);
	//对比度值
	_OsdRefresh_Family[_VL_ContrastRatio].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_ContrastRatio].Module_Property = 0xD0;
	MyArrayCopy(VL_ContrastRatio_Module_local,_OsdRefresh_Family[_VL_ContrastRatio].Module_local);
	MyArrayCopy(VL_ContrastRatio_Module_addr,_OsdRefresh_Family[_VL_ContrastRatio].Module_addr);
	_OsdRefresh_Family[_VL_ContrastRatio].Data = StrTODec(_OsdRefresh_Family[_VL_ContrastRatio].Module_addr);

	//模式标识
	_OsdRefresh_Family[_VL_ModeFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_ModeFlag].Module_Property = 0xD0;
	MyArrayCopy(VL_ModeFlag_Module_local,_OsdRefresh_Family[_VL_ModeFlag].Module_local);
	MyArrayCopy(VL_ModeFlag_Module_addr,_OsdRefresh_Family[_VL_ModeFlag].Module_addr);
	//模式度值
	_OsdRefresh_Family[_VL_Mode].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_Mode].Module_Property = 0xD0;
	MyArrayCopy(VL_Mode_Module_local,_OsdRefresh_Family[_VL_Mode].Module_local);
	MyArrayCopy(VL_Mode_Module_addr,_OsdRefresh_Family[_VL_Mode].Module_addr);
	_OsdRefresh_Family[_VL_Mode].Data = StrTODec(_OsdRefresh_Family[_VL_Mode].Module_addr);
	
	//动态范围标识
	_OsdRefresh_Family[_VL_DWDRFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_DWDRFlag].Module_Property = 0xD0;
	MyArrayCopy(VL_DWDRFlag_Module_local,_OsdRefresh_Family[_VL_DWDRFlag].Module_local);
	MyArrayCopy(VL_DWDRFlag_Module_addr,_OsdRefresh_Family[_VL_DWDRFlag].Module_addr);
	//动态范围度值
	_OsdRefresh_Family[_VL_DWDR].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_DWDR].Module_Property = 0xD0;
	MyArrayCopy(VL_DWDR_Module_local,_OsdRefresh_Family[_VL_DWDR].Module_local);
	MyArrayCopy(VL_DWDR_Module_addr,_OsdRefresh_Family[_VL_DWDR].Module_addr);
	_OsdRefresh_Family[_VL_DWDR].Data = StrTODec(_OsdRefresh_Family[_VL_DWDR].Module_addr);
	
	//降噪标识
	_OsdRefresh_Family[_VL_DNRFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_DNRFlag].Module_Property = 0xD0;
	MyArrayCopy(VL_DNRFlag_Module_local,_OsdRefresh_Family[_VL_DNRFlag].Module_local);
	MyArrayCopy(VL_DNRFlag_Module_addr,_OsdRefresh_Family[_VL_DNRFlag].Module_addr);
	//降噪值
#if VL_MC_105Q

	_OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_DNR].Module_Property = 0xD0;
	MyArrayCopy(VL_DNR_Module_local,_OsdRefresh_Family[_VL_DNR].Module_local);
	MyArrayCopy(VL_DNR_Module_addr,_OsdRefresh_Family[_VL_DNR].Module_addr);
	_OsdRefresh_Family[_VL_DNR].Data = StrTODec(_OsdRefresh_Family[_VL_DNR].Module_addr);
#elif VL_YT_3578_HD
	_OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_DNR].Module_Property = 0xD0;
	MyArrayCopy(VL_DNR_Module_local,_OsdRefresh_Family[_VL_DNR].Module_local);
	MyArrayCopy(VL_DNR_Module_addr,_OsdRefresh_Family[_VL_DNR].Module_addr);
#endif
	//录像标识
	_OsdRefresh_Family[_VL_PRFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_PRFlag].Module_Property = 0xD0;
	MyArrayCopy(VL_PRFlag_Module_local,_OsdRefresh_Family[_VL_PRFlag].Module_local);
	MyArrayCopy(VL_PRFlag_Module_addr,_OsdRefresh_Family[_VL_PRFlag].Module_addr);
	//录像值
	_OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_PR].Module_Property = 0xD0;
	MyArrayCopy(VL_PR_Module_local,_OsdRefresh_Family[_VL_PR].Module_local);
	MyArrayCopy(VL_PR_Module_addr,_OsdRefresh_Family[_VL_PR].Module_addr);
	_OsdRefresh_Family[_VL_PR].Data = StrTODec(_OsdRefresh_Family[_VL_PR].Module_addr);
	
#if WiFi_Flag
	//Wifi标识
	_OsdRefresh_Family[_VL_WifiFlag].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_WifiFlag].Module_Property = 0xD0;
	MyArrayCopy(VL_WifiFlag_Module_local,_OsdRefresh_Family[_VL_WifiFlag].Module_local);
	MyArrayCopy(VL_WifiFlag_Module_addr,_OsdRefresh_Family[_VL_WifiFlag].Module_addr);
	//Wifi值
	_OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_Wifi].Module_Property = 0xD0;
	MyArrayCopy(VL_Wifi_Module_local,_OsdRefresh_Family[_VL_Wifi].Module_local);
	MyArrayCopy(VL_Wifi_Module_addr,_OsdRefresh_Family[_VL_Wifi].Module_addr);
	_OsdRefresh_Family[_VL_Wifi].Data = StrTODec(_OsdRefresh_Family[_VL_Wifi].Module_addr);
#endif	
//	//退出标识
//	_OsdRefresh_Family[_VL_Exit].Refresh_Flag = Refresh_no;
//	_OsdRefresh_Family[_VL_Exit].Module_Property = 0xD0;
//	MyArrayCopy(VL_Exit_Module_local,_OsdRefresh_Family[_VL_Exit].Module_local);
//	MyArrayCopy(VL_Exit_Module_addr,_OsdRefresh_Family[_VL_Exit].Module_addr);
	
	//光标值
	_OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_no;
	_OsdRefresh_Family[_VL_Cursor].Module_Property = 0xD0;
	MyArrayCopy(VL_Cursor_Module_local,_OsdRefresh_Family[_VL_Cursor].Module_local);
	MyArrayCopy(VL_Cursor_Module_addr,_OsdRefresh_Family[_VL_Cursor].Module_addr);
	_OsdRefresh_Family[_VL_Cursor].Data = StrTODec(_OsdRefresh_Family[_VL_Cursor].Module_addr);
}

/*
	raw 						行
	rank  					列
	DataAddr_Buff 	模块内容在NVM中的地址的缓存
	Size 						地址缓存的数组长度
Property					显示属性
	function  			osd 显示各模块
*/
void OsdDisplay_Module(uint8_t *local_xy, unsigned char *DataAddr_Buff, unsigned char  AddrSize,	uint8_t Property)
{
	CHAR_ATTRIB osd_px;
	uint8_t local_num = 0,data_num = 0;
	 
	osd_px.attrib = Property;//0xD0;    // D7..D5 - 属性; D4 --- CA[8]
	while( local_num<AddrSize)
	{
		osd_px.index = DataAddr_Buff[data_num];
		at7456E_write_char(local_xy[local_num],local_xy[local_num+1],&osd_px);
		local_num+=2;
		data_num++;
	}
}



/*
_OsdRefresh_Family：显示的模块数组
function : 检查是否有需要更新的OSD显示模块
*/
void CheckOsdReresh(OsdRefresh_Struct *_OsdRefresh_Family)
{
	uint8_t num,LocalSize,AddrSize;
	
	for(num=0;num<OsdModuleMainPage_Size;num++)
	{
		if(_OsdRefresh_Family[num].Refresh_Flag == Refresh_yes)
		{
//			AddrSize = MyStrlen(_OsdRefresh_Family[num].Module_addr);
//			LocalSize	= AddrSize * 2;//MyStrlen(_OsdRefresh_Family[num].Module_local); //得到显示模块位置长度
			if(num == _Satellite ||  num == _Numllite || num == _Altitude || num == _Distance || num == _Loading)
			{	
				switch(num)
				{
					case _Satellite:
						LocalSize = 4;//得到显示模块位置长度 
						break;
					case _Numllite:
						LocalSize = 4;//得到显示模块位置长度 
						break;
					case _Altitude:
						LocalSize = 10;//得到显示模块位置长度 
						break;
					case _Distance:
						LocalSize = 10;//得到显示模块位置长度 
						break;
					case _Loading :
						LocalSize = 20;
					default:
						break;
				}		 
			}
			else
			{
				LocalSize	= MyStrlen(_OsdRefresh_Family[num].Module_local); //得到显示模块位置长度
			}
			OsdDisplay_Module(_OsdRefresh_Family[num].Module_local,	_OsdRefresh_Family[num].Module_addr,	LocalSize,	_OsdRefresh_Family[num].Module_Property);//显示
			_OsdRefresh_Family[num].Refresh_Flag = Refresh_no;//更新标志复位
		}
	}
	
	
	//配置菜单
	for(num=OsdModuleMainPage_Size;num<OsdModuleConfigPage_Size+OsdModuleMainPage_Size;num++)
	{
		if(_OsdRefresh_Family[num].Refresh_Flag == Refresh_yes)
		{
//			if(num != _Cursor) //设置菜单的光标不在这更新
//			{
	//			AddrSize = MyStrlen(_OsdRefresh_Family[num].Module_addr);
	//			LocalSize	= AddrSize * 2;//MyStrlen(_OsdRefresh_Family[num].Module_local); //得到显示模块位置长度
				LocalSize	= MyStrlen(_OsdRefresh_Family[num].Module_local); //得到显示模块位置长度
				OsdDisplay_Module(_OsdRefresh_Family[num].Module_local,	_OsdRefresh_Family[num].Module_addr,	LocalSize,	_OsdRefresh_Family[num].Module_Property);//显示
				_OsdRefresh_Family[num].Refresh_Flag = Refresh_no;//更新标志复位
//			}
		}
	}
}

/*
function : 将状态模块写到缓存，等待场同步
*/

void RefreshModule_State(unsigned char *DataAddr,uint8_t size)
{
	MyArrayCopy(DataAddr,OsdRefresh_Family[_State].Module_addr);
	OsdRefresh_Family[_State].Refresh_Flag = Refresh_yes;
}


//设置osd显示 红外模式还是日光模式
void Set_OsdLight_Mode(_OsdLight_Mode  Mode)
{
	switch(Mode)
	{
		case _Daylight://白光
			OsdRefresh_Family[_State].Module_addr[0] = osd_h;
			OsdRefresh_Family[_State].Module_addr[1] = osd_w;
			break;
		case _Infrared://红外	
			OsdRefresh_Family[_State].Module_addr[0] = osd_b;
			OsdRefresh_Family[_State].Module_addr[1] = osd_g;
			break;
		default:
			break;
	}
}

//设置osd显示 拍照还是录像
void Set_Osd_PhotoRecord(_OsdRun_Mode Mode)
{
	switch(Mode)
	{
		case _PhotoMode://拍照
			OsdRefresh_Family[_PhotoRecord].Module_addr[0] = osd_Icon_photo_1;
			OsdRefresh_Family[_PhotoRecord].Module_addr[1] = osd_Icon_photo_2;
			OsdRefresh_Family[_PhotoRecord].Module_addr[2] = '\r';
		
			OsdRefresh_Family[_VL_PR].Module_addr[0] = osd_ON;
			OsdRefresh_Family[_VL_PR].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_VL_PR].Module_addr[2] = '\r';

			OsdRefresh_Family[_IR_PR].Module_addr[0] = osd_ON;
			OsdRefresh_Family[_IR_PR].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_IR_PR].Module_addr[2] = '\r';
			break;
		
		case _RecordMode://录像	
			OsdRefresh_Family[_PhotoRecord].Module_addr[0] = osd_Icon_record_1;
			OsdRefresh_Family[_PhotoRecord].Module_addr[1] = osd_Icon_record_2;
			OsdRefresh_Family[_PhotoRecord].Module_addr[2] = '\r';
			break;
		
		case _PROFF://录像	
			OsdRefresh_Family[_PhotoRecord].Module_addr[0] = osd_NONE;
			OsdRefresh_Family[_PhotoRecord].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_PhotoRecord].Module_addr[2] = '\r';
		
			OsdRefresh_Family[_VL_PR].Module_addr[0] = osd_OF;
			OsdRefresh_Family[_VL_PR].Module_addr[1] = osd_F_0;
			OsdRefresh_Family[_VL_PR].Module_addr[2] = '\r';

			OsdRefresh_Family[_IR_PR].Module_addr[0] = osd_OF;
			OsdRefresh_Family[_IR_PR].Module_addr[1] = osd_F_0;
			OsdRefresh_Family[_IR_PR].Module_addr[2] = '\r';
			break;
		default:
			break;
	}
}
#if BT656 
//设置osd显示	户外模式开关
void Set_Osd_OutDoor(_OutDoor_Pra Mode)
{
	switch(Mode)
	{
		case _OutDoor_Off://关			
			OsdRefresh_Family[_IR_OutDoor].Module_addr[0] = osd_OF;
			OsdRefresh_Family[_IR_OutDoor].Module_addr[1] = osd_F_0;
			OsdRefresh_Family[_IR_OutDoor].Module_addr[2] = '\r';
			break;
		
		case _OutDoor_On://开
		
			OsdRefresh_Family[_IR_OutDoor].Module_addr[0] = osd_ON;
			OsdRefresh_Family[_IR_OutDoor].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_IR_OutDoor].Module_addr[2] = '\r';
			break;
		default:
			break;
	}
}

#endif


#if WiFi_Flag 
//设置osd显示	Wifi开关
void Set_Osd_Wifi(_WIFI_Mode Mode)
{
	switch(Mode)
	{
		case _WIFI_OFF://关
			OsdRefresh_Family[_Wifi].Module_addr[0] = osd_NONE;
			OsdRefresh_Family[_Wifi].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_Wifi].Module_addr[2] = '\r';
							
			OsdRefresh_Family[_VL_Wifi].Module_addr[0] = osd_OF;
			OsdRefresh_Family[_VL_Wifi].Module_addr[1] = osd_F_0;
			OsdRefresh_Family[_VL_Wifi].Module_addr[2] = '\r';

			OsdRefresh_Family[_IR_Wifi].Module_addr[0] = osd_OF;
			OsdRefresh_Family[_IR_Wifi].Module_addr[1] = osd_F_0;
			OsdRefresh_Family[_IR_Wifi].Module_addr[2] = '\r';
			break;
		
		case _WIFI_ON://开
			OsdRefresh_Family[_Wifi].Module_addr[0] = osd_Icon_wifi_1;
			OsdRefresh_Family[_Wifi].Module_addr[1] = osd_Icon_wifi_2;
			OsdRefresh_Family[_Wifi].Module_addr[2] = '\r';
		
			OsdRefresh_Family[_VL_Wifi].Module_addr[0] = osd_ON;
			OsdRefresh_Family[_VL_Wifi].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_VL_Wifi].Module_addr[2] = '\r';

			OsdRefresh_Family[_IR_Wifi].Module_addr[0] = osd_ON;
			OsdRefresh_Family[_IR_Wifi].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_IR_Wifi].Module_addr[2] = '\r';
			break;
		default:
			break;
	}
}
#endif
//使录像图标闪烁
void RecordIconBlink(_OsdRun_Mode OsdRun_Mode)
{	
	static	uint8_t num = 0;
	static	_Bool Flag=FALSE;
	static 	uint8_t		MAXTIME = 60; 
	static 	uint8_t		OFFTIME;
	
	OFFTIME = MAXTIME/2;
	
	num++;
	Flag=num>MAXTIME?TRUE:FALSE;
	
	if(OsdRun_Mode == _RecordMode && Flag==TRUE) //录像
		{
			OsdRefresh_Family[_PhotoRecord].Module_addr[0] = osd_NONE;
			OsdRefresh_Family[_PhotoRecord].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_PhotoRecord].Module_addr[2] = '\r';
			OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_yes;
			Flag = FALSE;
			num=0;
		}
	else if(OsdRun_Mode == _RecordMode	&& Flag!=TRUE && num > OFFTIME/2)
		{
			OsdRefresh_Family[_PhotoRecord].Module_addr[0] = osd_Icon_record_1;
			OsdRefresh_Family[_PhotoRecord].Module_addr[1] = osd_Icon_record_2;
			OsdRefresh_Family[_PhotoRecord].Module_addr[2] = '\r';
			OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_yes;
			Flag = FALSE;
		}
}
uint8_t Control_Num_Blink(_MenuLevel MenuLevel, _ConfigMenuPra *ConfigMenuPra)
{	
	
	
	
	static	uint8_t num = 0;
	static	_Bool Flag=FALSE;
	static 	uint8_t		MAXTIME = 60; 
	static 	uint8_t		OFFTIME;
	
	
		OFFTIME = MAXTIME/2;
		
		num++;
		Flag=num>MAXTIME?TRUE:FALSE;
		
	switch(OsdLight_Mode)
	{
		case _Infrared:
			
		if(MenuLevel == _ParameterSet && Flag == TRUE) //录像
			{
				switch( *ConfigMenuPra )
				{
					case _IR_Brightness :
							OsdRefresh_Family[_IR_Brightness].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_IR_Brightness].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_IR_Brightness].Module_addr[2] = '\r';
							OsdRefresh_Family[_IR_Brightness].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
					case _IR_ContrastRatio :
							OsdRefresh_Family[_IR_ContrastRatio].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_IR_ContrastRatio].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_IR_ContrastRatio].Module_addr[2] = '\r';
							OsdRefresh_Family[_IR_ContrastRatio].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
					
					
					case _IR_Enhance :
							OsdRefresh_Family[_IR_Enhance].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_IR_Enhance].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_IR_Enhance].Module_addr[2] = '\r';
							OsdRefresh_Family[_IR_Enhance].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
#if ChengDu					
					case _IR_DNR :
							OsdRefresh_Family[_IR_DNR].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_IR_DNR].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_IR_DNR].Module_addr[2] = '\r';
							OsdRefresh_Family[_IR_DNR].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
#elif BT656 
					case _IR_OutDoor :
							OsdRefresh_Family[_IR_OutDoor].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_IR_OutDoor].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_IR_OutDoor].Module_addr[2] = '\r';
							OsdRefresh_Family[_IR_OutDoor].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
					
	

#endif					
					
					case _IR_Polar :
							OsdRefresh_Family[_IR_Polar].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_IR_Polar].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_IR_Polar].Module_addr[2] = osd_NONE;	
							OsdRefresh_Family[_IR_Polar].Module_addr[3] = osd_NONE;	
							OsdRefresh_Family[_IR_Polar].Module_addr[4] = '\r';
							OsdRefresh_Family[_IR_Polar].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
					
					case _IR_PR :
							OsdRefresh_Family[_IR_PR].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_IR_PR].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_IR_PR].Module_addr[2] = '\r';
							OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
#if WiFi_Flag					
					case _IR_Wifi :
							OsdRefresh_Family[_IR_Wifi].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_IR_Wifi].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_IR_Wifi].Module_addr[2] = '\r';
							OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
#endif	
					
					default:
						break;
						
				}
			}
		else if((MenuLevel == _ParameterSet && Flag!=TRUE && num > OFFTIME/2 )|| MenuLevel == _ConfigMenu) 
			{
				switch( *ConfigMenuPra )
				{
					case _IR_Brightness :
							DecToHexToAscii(OsdRefresh_Family[_IR_Brightness].Data, 0, OsdRefresh_Family[_IR_Brightness].Module_addr, 1);
							SmallToBig(OsdRefresh_Family[_IR_Brightness].Module_addr);
							OsdRefresh_Family[_IR_Brightness].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
					break;
					case _IR_ContrastRatio :
							DecToHexToAscii(OsdRefresh_Family[_IR_ContrastRatio].Data, 0, OsdRefresh_Family[_IR_ContrastRatio].Module_addr, 1);
							SmallToBig(OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
							OsdRefresh_Family[_IR_ContrastRatio].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
					break;
			
					
					case _IR_Enhance :
							DecToHexToAscii(OsdRefresh_Family[_IR_Enhance].Data, 0, OsdRefresh_Family[_IR_Enhance].Module_addr, 1);
							SmallToBig(OsdRefresh_Family[_IR_Enhance].Module_addr);
							OsdRefresh_Family[_IR_Enhance].Refresh_Flag = Refresh_yes;

							Flag = FALSE;
					break;
#if ChengDu
					case _IR_DNR :
							DecToHexToAscii(OsdRefresh_Family[_IR_DNR].Data, 0, OsdRefresh_Family[_IR_DNR].Module_addr, 1);
							SmallToBig(OsdRefresh_Family[_IR_DNR].Module_addr);
							OsdRefresh_Family[_IR_DNR].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
					break;	
#elif BT656 
					case _IR_OutDoor :
							
							OsdRefresh_Family[_IR_OutDoor].Refresh_Flag = Refresh_yes;
					        Set_Osd_OutDoor(OutDoor_Pra);
							Flag = FALSE;
					break;	

#endif					
					
		            case _IR_Polar :
							Set_Osd_Infrared_ColorMode(Osd_Infrared_ColorMode);
							OsdRefresh_Family[_IR_Polar].Refresh_Flag = Refresh_yes;
							OsdRefresh_Family[_IR_Polar].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
					break;
					
					case _IR_PR :
						OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_yes;
						//设置白光模式下的动态范围
						Set_Osd_PhotoRecord(OsdRun_Mode);
							Flag = FALSE;
					break;
#if WiFi_Flag					
					case _IR_Wifi :
						OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_yes;
						//设置白光模式下的动态范围
						Set_Osd_Wifi(WIFI_Mode);
							Flag = FALSE;
					break;
#endif		
					
					default:
					break;						
					}
				
		   }
		
		break;
		
		case _Daylight:
		if(MenuLevel == _ParameterSet && Flag == TRUE) //录像
			{
				switch( *ConfigMenuPra )
				{
					case _VL_Brightness :
							OsdRefresh_Family[_VL_Brightness].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_VL_Brightness].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_VL_Brightness].Module_addr[2] = '\r';
							OsdRefresh_Family[_VL_Brightness].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
					case _VL_ContrastRatio :
							OsdRefresh_Family[_VL_ContrastRatio].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_VL_ContrastRatio].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_VL_ContrastRatio].Module_addr[2] = '\r';
							OsdRefresh_Family[_VL_ContrastRatio].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
					case _VL_Mode :
							OsdRefresh_Family[_VL_Mode].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_VL_Mode].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_VL_Mode].Module_addr[2] = osd_NONE;	
							OsdRefresh_Family[_VL_Mode].Module_addr[3] = osd_NONE;	
							OsdRefresh_Family[_VL_Mode].Module_addr[4] = '\r';
							OsdRefresh_Family[_VL_Mode].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
					case _VL_DWDR :
							OsdRefresh_Family[_VL_DWDR].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_VL_DWDR].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_VL_DWDR].Module_addr[2] = '\r';
							OsdRefresh_Family[_VL_DWDR].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
					case _VL_DNR :
							OsdRefresh_Family[_VL_DNR].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_VL_DNR].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_VL_DNR].Module_addr[2] = '\r';
							OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
					case _VL_PR :
							OsdRefresh_Family[_VL_PR].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_VL_PR].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_VL_PR].Module_addr[2] = '\r';
							OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
#if WiFi_Flag	
					case _VL_Wifi :
							OsdRefresh_Family[_VL_Wifi].Module_addr[0] = osd_NONE;
							OsdRefresh_Family[_VL_Wifi].Module_addr[1] = osd_NONE;
							OsdRefresh_Family[_VL_Wifi].Module_addr[2] = '\r';
							OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
							num=0;
					break;
#endif	
					default:
						
          break;	
				}
			}
		else if((MenuLevel == _ParameterSet && Flag!=TRUE && num > OFFTIME/2 )|| MenuLevel == _ConfigMenu) 
			{
				switch( *ConfigMenuPra )
				{
					case _VL_Brightness :
							DecToHexToAscii(OsdRefresh_Family[_VL_Brightness].Data, 0, OsdRefresh_Family[_VL_Brightness].Module_addr, 1);
							SmallToBig(OsdRefresh_Family[_VL_Brightness].Module_addr);
							OsdRefresh_Family[_VL_Brightness].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
					break;
					case _VL_ContrastRatio :
							DecToHexToAscii(OsdRefresh_Family[_VL_ContrastRatio].Data, 0, OsdRefresh_Family[_VL_ContrastRatio].Module_addr, 1);
							SmallToBig(OsdRefresh_Family[_VL_ContrastRatio].Module_addr);
							OsdRefresh_Family[_VL_ContrastRatio].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
					break;
					case _VL_Mode :
							Set_Osd_Daylight_ColorMode(Osd_Daylight_ColorMode);
							OsdRefresh_Family[_Daylight_ColorMode].Refresh_Flag = Refresh_yes;
							OsdRefresh_Family[_VL_Mode].Refresh_Flag = Refresh_yes;
							Flag = FALSE;
					break;
					case _VL_DWDR :
						OsdRefresh_Family[_VL_DWDR].Refresh_Flag = Refresh_yes;
						//设置白光模式下的动态范围
						Set_Osd_Daylight_DWDR(DWR_Pra);
							Flag = FALSE;
					break;
					case _VL_DNR :
						OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_yes;
						Set_Osd_Daylight_DNR(DNR_Pra);
							Flag = FALSE;
					break;	
					
					case _VL_PR :
						OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_yes;
						//设置白光模式下的动态范围
						Set_Osd_PhotoRecord(OsdRun_Mode);
							Flag = FALSE;
					break;
#if WiFi_Flag
					case _VL_Wifi :
						OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_yes;
						//设置白光模式下的动态范围
						Set_Osd_Wifi(WIFI_Mode);
							Flag = FALSE;
					break;
#endif		
					default:
					break;						
					}
				
		   }
		
		break;
		
	
	}
		
			
		return 1;
	
}
//使拍照图标闪烁
void PhotoIconBlink(_OsdRun_Mode OsdRun_Mode)
{	
	static	uint8_t Time = 0;
	static uint8_t blink_flag = 0;

	_OsdRun_Mode Photo_data;
		
	if(OsdRun_Mode == _PhotoMode && pdTRUE == xQueueReceive(Photo_QueueHandle,&Photo_data,0))
		{
			if(Photo_data == _PhotoMode)
			{
				Time = 0;
				blink_flag = 1;
				OsdRefresh_Family[_PhotoRecord].Module_addr[0] = osd_NONE;
				OsdRefresh_Family[_PhotoRecord].Module_addr[1] = osd_NONE;
				OsdRefresh_Family[_PhotoRecord].Module_addr[2] = '\r';
				OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_yes;
			}
		}
	else if(OsdRun_Mode == _PhotoMode)
		{
			if(blink_flag == 1)
				Time++;
			
			if(Time > 10)
			{
				Time = 0;
				blink_flag = 0;
				OsdRefresh_Family[_PhotoRecord].Module_addr[0] = osd_Icon_photo_1;
				OsdRefresh_Family[_PhotoRecord].Module_addr[1] = osd_Icon_photo_2;
				OsdRefresh_Family[_PhotoRecord].Module_addr[2] = '\r';
				OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_yes;
			}
		}
}


//使激光图标闪烁
void LaserIconBlink(void)
{	
	static	uint8_t Time = 0;
	static uint8_t blink_flag = 0;

	bool Laser_data;
		
	if(pdTRUE == xQueueReceive(Laser_QueueHandle,&Laser_data,0))
		{
			Time = 0;
			blink_flag = 1;
			OsdRefresh_Family[_LaserFlag].Module_addr[0] = osd_NONE;
			OsdRefresh_Family[_LaserFlag].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_LaserFlag].Module_addr[2] = '\r';
			OsdRefresh_Family[_LaserFlag].Refresh_Flag = Refresh_yes;
		}
	else
		{
			if(blink_flag == 1)
				Time++;
			
			if(Time > 10)
			{
				Time = 0;
				blink_flag = 0;
				OsdRefresh_Family[_LaserFlag].Module_addr[0] = osd_Icon_Laser_1;
				OsdRefresh_Family[_LaserFlag].Module_addr[1] = osd_Icon_Laser_2;
				OsdRefresh_Family[_LaserFlag].Module_addr[2] = '\r';
				OsdRefresh_Family[_LaserFlag].Refresh_Flag = Refresh_yes;
			}
		}
}

void ClearCursor_OsdShow(void)
{
	
	uint8_t local_buff[3] = {0};
	unsigned char DataAddr_Buff[2]= {0};
	
		switch(OsdLight_Mode)
		{
			case _Infrared:
					//擦除亮度前的光标
					local_buff[0] = IR_BrightnessFlag_Module_local[0];
					local_buff[1] = IR_BrightnessFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
					//擦除对比度前的光标
					local_buff[0] = IR_ContrastRatioFlag_Module_local[0];
					local_buff[1] = IR_ContrastRatioFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
					//擦除增强值前的光标
					local_buff[0] = IR_EnhanceFlag_Module_local[0];
					local_buff[1] = IR_EnhanceFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
#if ChengDu
					//擦除增强值前的光标
					local_buff[0] = IR_DNRFlag_Module_local[0];
					local_buff[1] = IR_DNRFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
#elif BT656 
					local_buff[0] = IR_OutDoorFlag_Module_local[0];
					local_buff[1] = IR_OutDoorFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
#endif
					//擦除伪彩前的光标
					local_buff[0] = IR_PolarFlag_Module_local[0];
					local_buff[1] = IR_PolarFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
					//擦除拍摄前的光标
					local_buff[0] = IR_PRFlag_Module_local[0];
					local_buff[1] = IR_PRFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
#if WiFi_Flag					
					//擦除Wify前的光标
					local_buff[0] = IR_WifiFlag_Module_local[0];
					local_buff[1] = IR_WifiFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
#endif	
					//擦除退出前的光标
					local_buff[0] = IR_Exit_Module_local[0];
					local_buff[1] = IR_Exit_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
				break;		
				
			case _Daylight:
					//擦除亮度前的光标
					local_buff[0] = VL_BrightnessFlag_Module_local[0];
					local_buff[1] = VL_BrightnessFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
					//擦除对比度前的光标
					local_buff[0] = VL_ContrastRatioFlag_Module_local[0];
					local_buff[1] = VL_ContrastRatioFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
					//擦除增强值前的光标
					local_buff[0] = VL_ModeFlag_Module_local[0];
					local_buff[1] = VL_ModeFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
					//擦除画中画前的光标
					local_buff[0] = VL_DWDRFlag_Module_local[0];
					local_buff[1] = VL_DWDRFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
					//擦除伪彩前的光标
					local_buff[0] = VL_DNRFlag_Module_local[0];
					local_buff[1] = VL_DNRFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
					//擦除拍摄前的光标
					local_buff[0] = VL_PRFlag_Module_local[0];
					local_buff[1] = VL_PRFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
#if WiFi_Flag					
					//擦除Wify前的光标
					local_buff[0] = VL_WifiFlag_Module_local[0];
					local_buff[1] = VL_WifiFlag_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
#endif	
					//擦除退出前的光标
					local_buff[0] = VL_Exit_Module_local[0];
					local_buff[1] = VL_Exit_Module_local[1] - 1;
					local_buff[2] = '\r';
					DataAddr_Buff[0] = 0;
					OsdDisplay_Module(local_buff,	DataAddr_Buff,	1,	0XD0);//显示
					
				break;
			
			default:
				break;
		}
}

void CursorMove_OsdShow(void)
{
	_Bool Cursor_data;
	static uint8_t temp;
	if(pdTRUE == xQueueReceive(Cursor_QueueHandle,&Cursor_data,0))
	{
			if(Cursor_data == TRUE)
			{
				ClearCursor_OsdShow();
			}
	}
}

//光标复位
void CursorReset_OsdShow(void)
{
		ClearCursor_OsdShow();
		OsdRefresh_Family[_VL_Cursor].Module_local[0] = OsdRefresh_Family[_VL_BrightnessFlag].Module_local[0];
		OsdRefresh_Family[_VL_Cursor].Module_local[1] = OsdRefresh_Family[_VL_BrightnessFlag].Module_local[1] - 1;
		OsdRefresh_Family[_IR_Cursor].Module_local[0] = OsdRefresh_Family[_IR_BrightnessFlag].Module_local[0];
		OsdRefresh_Family[_IR_Cursor].Module_local[1] = OsdRefresh_Family[_IR_BrightnessFlag].Module_local[1] - 1;

}

//设置白光模式下的颜色模式
void Set_Osd_Daylight_ColorMode(_Osd_Daylight_ColorMode Daylight_ColorMode)
{
	switch(Daylight_ColorMode)
	{
		case _Auto:
			OsdRefresh_Family[_VL_Mode].Module_addr[0] = osd_AU;
			OsdRefresh_Family[_VL_Mode].Module_addr[1] = osd_TO;
			OsdRefresh_Family[_VL_Mode].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_VL_Mode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_Mode].Module_addr[4] = '\r';
			
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[0] = osd_AU;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[1] = osd_TO;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[4] = '\r';
			break;
		case _Day:
			OsdRefresh_Family[_VL_Mode].Module_addr[0] = osd_DA;
			OsdRefresh_Family[_VL_Mode].Module_addr[1] = osd_Y_0;
			OsdRefresh_Family[_VL_Mode].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_VL_Mode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_Mode].Module_addr[4] = '\r';
		
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[0] = osd_DA;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[1] = osd_Y_0;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[4] = '\r';
			break;
		case _Night:
			OsdRefresh_Family[_VL_Mode].Module_addr[0] = osd_NI;
			OsdRefresh_Family[_VL_Mode].Module_addr[1] = osd_GH;
			OsdRefresh_Family[_VL_Mode].Module_addr[2] = osd_T_0;
			OsdRefresh_Family[_VL_Mode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_Mode].Module_addr[4] = '\r';
		
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[0] = osd_NI;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[1] = osd_GH;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[2] = osd_T_0;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[4] = '\r';
			break;
		case _Defog_Low:
			OsdRefresh_Family[_VL_Mode].Module_addr[0] = osd_DE;
			OsdRefresh_Family[_VL_Mode].Module_addr[1] = osd_FO;
			OsdRefresh_Family[_VL_Mode].Module_addr[2] = osd_G1;
			OsdRefresh_Family[_VL_Mode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_Mode].Module_addr[4] = '\r';
		
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[0] = osd_DE;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[1] = osd_FO;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[2] = osd_G1;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[4] = '\r';
			break;
		
		case _Defog_Mid:
			OsdRefresh_Family[_VL_Mode].Module_addr[0] = osd_DE;
			OsdRefresh_Family[_VL_Mode].Module_addr[1] = osd_FO;
			OsdRefresh_Family[_VL_Mode].Module_addr[2] = osd_G2;
			OsdRefresh_Family[_VL_Mode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_Mode].Module_addr[4] = '\r';
		
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[0] = osd_DE;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[1] = osd_FO;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[2] = osd_G2;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[4] = '\r';
			break;
				
		case _Defog_Hig:
			OsdRefresh_Family[_VL_Mode].Module_addr[0] = osd_DE;
			OsdRefresh_Family[_VL_Mode].Module_addr[1] = osd_FO;
			OsdRefresh_Family[_VL_Mode].Module_addr[2] = osd_G3;
			OsdRefresh_Family[_VL_Mode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_Mode].Module_addr[4] = '\r';
		
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[0] = osd_DE;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[1] = osd_FO;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[2] = osd_G3;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_Daylight_ColorMode].Module_addr[4] = '\r';
			break;

		default:
			break;
	}
}


//设置白光模式下的动态范围
void Set_Osd_Daylight_DWDR(_DWR_Pra DWDR)
{
	switch(DWDR)
	{
		case _DWR_Off:
			OsdRefresh_Family[_VL_DWDR].Module_addr[0] = osd_OF;
			OsdRefresh_Family[_VL_DWDR].Module_addr[1] = osd_F_0;
			OsdRefresh_Family[_VL_DWDR].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_VL_DWDR].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_DWDR].Module_addr[4] = '\r';
			
			break;
		case _DWR_Low:
			OsdRefresh_Family[_VL_DWDR].Module_addr[0] = osd_LO;
			OsdRefresh_Family[_VL_DWDR].Module_addr[1] = osd_W_0;
			OsdRefresh_Family[_VL_DWDR].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_VL_DWDR].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_DWDR].Module_addr[4] = '\r';
		
			break;
		case _DWR_Mid:
			OsdRefresh_Family[_VL_DWDR].Module_addr[0] = osd_MI;
			OsdRefresh_Family[_VL_DWDR].Module_addr[1] = osd_D_0;
			OsdRefresh_Family[_VL_DWDR].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_VL_DWDR].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_DWDR].Module_addr[4] = '\r';
		
			break;
		case _DWR_Hig:
			OsdRefresh_Family[_VL_DWDR].Module_addr[0] = osd_HI;
			OsdRefresh_Family[_VL_DWDR].Module_addr[1] = osd_G_0;
			OsdRefresh_Family[_VL_DWDR].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_VL_DWDR].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_DWDR].Module_addr[4] = '\r';
			break;

		default:
			break;
	}
}

//设置白光模式下的降噪范围
void Set_Osd_Daylight_DNR(_DNR_Pra DNR)
{
	switch(DNR)
	{
		case _DNR_Off:
			OsdRefresh_Family[_VL_DNR].Module_addr[0] = osd_OF;
			OsdRefresh_Family[_VL_DNR].Module_addr[1] = osd_F_0;
			OsdRefresh_Family[_VL_DNR].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_VL_DNR].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_DNR].Module_addr[4] = '\r';
			
			break;
		case _DNR_Low:
			OsdRefresh_Family[_VL_DNR].Module_addr[0] = osd_LO;
			OsdRefresh_Family[_VL_DNR].Module_addr[1] = osd_W_0;
			OsdRefresh_Family[_VL_DNR].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_VL_DNR].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_DNR].Module_addr[4] = '\r';
		
			break;
		case _DNR_Mid:
			OsdRefresh_Family[_VL_DNR].Module_addr[0] = osd_MI;
			OsdRefresh_Family[_VL_DNR].Module_addr[1] = osd_D_0;
			OsdRefresh_Family[_VL_DNR].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_VL_DNR].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_DNR].Module_addr[4] = '\r';
		
			break;
		case _DNR_Hig:
			OsdRefresh_Family[_VL_DNR].Module_addr[0] = osd_HI;
			OsdRefresh_Family[_VL_DNR].Module_addr[1] = osd_G_0;
			OsdRefresh_Family[_VL_DNR].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_VL_DNR].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_VL_DNR].Module_addr[4] = '\r';
			break;

		default:
			break;
	}
}





//设置红外模式下的色彩模式
void Set_Osd_Infrared_ColorMode(_Osd_Infrared_ColorMode Mode)
{
	switch(Mode)
	{
		case _WhiteHot://白热
			OsdRefresh_Family[_IR_Polar].Module_addr[0] = osd_WH;
			OsdRefresh_Family[_IR_Polar].Module_addr[1] = osd_OT;
			OsdRefresh_Family[_IR_Polar].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Polar].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_IR_Polar].Module_addr[4] = '\r';
			
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[0] = osd_WH;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[1] = osd_OT;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[4] = '\r';
			break;
		case _BlackHot://黑热	
			OsdRefresh_Family[_IR_Polar].Module_addr[0] = osd_BH;
			OsdRefresh_Family[_IR_Polar].Module_addr[1] = osd_OT;
			OsdRefresh_Family[_IR_Polar].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Polar].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_IR_Polar].Module_addr[4] = '\r';
		
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[0] = osd_BH;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[1] = osd_OT;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[4] = '\r';
			break;
#if ChengDu 		
		case _Rainbow://彩红
			OsdRefresh_Family[_IR_Polar].Module_addr[0] = osd_RA;
			OsdRefresh_Family[_IR_Polar].Module_addr[1] = osd_IN;
			OsdRefresh_Family[_IR_Polar].Module_addr[2] = osd_BO;
			OsdRefresh_Family[_IR_Polar].Module_addr[3] = osd_W_0;
			OsdRefresh_Family[_IR_Polar].Module_addr[4] = '\r';
		
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[0] = osd_RA;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[1] = osd_IN;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[2] = osd_BO;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[3] = osd_W_0;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[4] = '\r';
			break;
#elif BT656 

#endif
		case _Iron://热金属	
			OsdRefresh_Family[_IR_Polar].Module_addr[0] = osd_IR;
			OsdRefresh_Family[_IR_Polar].Module_addr[1] = osd_ON;
			OsdRefresh_Family[_IR_Polar].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Polar].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_IR_Polar].Module_addr[4] = '\r';
		
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[0] = osd_IR;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[1] = osd_ON;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[4] = '\r';
			break;
		case _GreenHot://绿热
			OsdRefresh_Family[_IR_Polar].Module_addr[0] = osd_GH;
			OsdRefresh_Family[_IR_Polar].Module_addr[1] = osd_OT;
			OsdRefresh_Family[_IR_Polar].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Polar].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_IR_Polar].Module_addr[4] = '\r';
		
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[0] = osd_GH;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[1] = osd_OT;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[3] = osd_NONE;
			OsdRefresh_Family[_Infrared_ColorMode].Module_addr[4] = '\r';
			break;
		default:
			break;
	}
}

//

void Set_Osd_LightMode(_OsdLight_Mode Mode)
{
	switch(Mode)
	{
		case _Daylight:	//白光
			OsdRefresh_Family[_State].Module_addr[0] = osd_VL;
			OsdRefresh_Family[_State].Module_addr[1] = '\r';
			break;
		case _Infrared://红外
			OsdRefresh_Family[_State].Module_addr[0] = osd_IR;
			OsdRefresh_Family[_State].Module_addr[1] = '\r';
			break;
		default:
			break;
	}
}

//白光模式下OSD要展示的元素 重新更新
void DaylightOsdShow(void)
{
	
	GPS_Refresh_Set();
	OsdRefresh_Family[_AimLine].Refresh_Flag = Refresh_yes;//描线
	OsdRefresh_Family[_State].Refresh_Flag = Refresh_yes; 							//状态 白光
	OsdRefresh_Family[_Daylight_ColorMode].Refresh_Flag = Refresh_yes; 	// 白光颜色模式
	if(Flag_LsserON == true)
	{
		OsdRefresh_Family[_LaserFlag].Refresh_Flag = Refresh_yes; 	// 激光图标
		OsdRefresh_Family[_Distance].Refresh_Flag = Refresh_yes;           //距离
	}
	OsdRefresh_Family[_VL_Zoom].Refresh_Flag = Refresh_yes; 		//缩放倍数 
	//OsdRefresh_Family[_ForwardReverse].Refresh_Flag = Refresh_yes;
#if	WiFi_Flag
	if(WIFI_Mode	!= _WIFI_OFF)
		OsdRefresh_Family[_Wifi].Refresh_Flag = Refresh_yes; 								//_Wifi
#endif	
	if(OsdRun_Mode	!= _PROFF)
		OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_yes; 				// 录像拍照
	OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes; 							//电量
	//OsdRefresh_Family[_Distance].Refresh_Flag = Refresh_yes;           //距离
	OsdRefresh_Family[_Position].Refresh_Flag = Refresh_yes; 						//方位
	OsdRefresh_Family[_Pitch].Refresh_Flag = Refresh_yes; 							//俯仰
}

//切红外把所有白光要展示的模块清遍
void EraseDaylightOsdShow(void)
{
	OsdRefresh_Family[_AimLine].Refresh_Flag = Refresh_no;//描线
	OsdRefresh_Family[_State].Refresh_Flag = Refresh_no; 							//状态 白光
	OsdRefresh_Family[_Daylight_ColorMode].Refresh_Flag = Refresh_no; 	// 白光颜色模式
	OsdRefresh_Family[_LaserFlag].Refresh_Flag = Refresh_no; 	// 激光图标
	
	OsdRefresh_Family[_VL_Zoom].Refresh_Flag = Refresh_no; 		//缩放倍数 
	//OsdRefresh_Family[_ForwardReverse].Refresh_Flag = Refresh_yes;
#if WiFi_Flag		
	if(WIFI_Mode	!= _WIFI_OFF)
		OsdRefresh_Family[_Wifi].Refresh_Flag = Refresh_no; 								//_Wifi
#endif	
	if(OsdRun_Mode	!= _PROFF)
		OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_no; 				// 录像拍照
	OsdRefresh_Family[_Power].Refresh_Flag = Refresh_no; 							//电量
	OsdRefresh_Family[_Distance].Refresh_Flag = Refresh_no;           //距离
	OsdRefresh_Family[_Position].Refresh_Flag = Refresh_no; 						//方位
	OsdRefresh_Family[_Pitch].Refresh_Flag = Refresh_no; 							//俯仰
}

//红外模式下OSD要展示的元素 重新更新
void InfraredOsdShow(void)
{
	GPS_Refresh_Set();
	OsdRefresh_Family[_AimLine].Refresh_Flag = Refresh_yes;//描线
	OsdRefresh_Family[_State].Refresh_Flag = Refresh_yes; 							//状态 红外
	OsdRefresh_Family[_Infrared_ColorMode].Refresh_Flag = Refresh_yes; 	// 红外颜色模式
	if(Flag_LsserON == true)
	{
		OsdRefresh_Family[_LaserFlag].Refresh_Flag = Refresh_yes; 	// 激光图标
		OsdRefresh_Family[_Distance].Refresh_Flag = Refresh_yes;           //距离
	}
	OsdRefresh_Family[_IR_Zoom].Refresh_Flag = Refresh_yes; 		//缩放倍数 
#if WiFi_Flag		
	if(WIFI_Mode	!= _WIFI_OFF)
	OsdRefresh_Family[_Wifi].Refresh_Flag = Refresh_yes; 								//_Wifi
#endif	
	if(OsdRun_Mode	!= _PROFF)
		OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_yes; 				// 录像拍照
	OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes; 							//电量

	OsdRefresh_Family[_Position].Refresh_Flag = Refresh_yes; 						//方位
	OsdRefresh_Family[_Pitch].Refresh_Flag = Refresh_yes; 							//俯仰
}

//切白光把所有白光要展示的模块清遍
void EraseInfraredOsdShow(void)
{
	OsdRefresh_Family[_AimLine].Refresh_Flag = Refresh_no;//描线
	OsdRefresh_Family[_State].Refresh_Flag = Refresh_no; 							//状态 红外
	OsdRefresh_Family[_Infrared_ColorMode].Refresh_Flag = Refresh_no; 	// 红外颜色模式
	OsdRefresh_Family[_LaserFlag].Refresh_Flag = Refresh_no; 	// 激光图标
	
	OsdRefresh_Family[_IR_Zoom].Refresh_Flag = Refresh_no; 		//缩放倍数 
#if WiFi_Flag		
	if(WIFI_Mode	!= _WIFI_OFF)
	OsdRefresh_Family[_Wifi].Refresh_Flag = Refresh_no; 								//_Wifi
#endif	
	if(OsdRun_Mode	!= _PROFF)
		OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_no; 				// 录像拍照
	OsdRefresh_Family[_Power].Refresh_Flag = Refresh_no; 							//电量
	OsdRefresh_Family[_Distance].Refresh_Flag = Refresh_no;           //距离
	OsdRefresh_Family[_Position].Refresh_Flag = Refresh_no; 						//方位
	OsdRefresh_Family[_Pitch].Refresh_Flag = Refresh_no; 							//俯仰
}
	

//设置电机正传图标
void MotorForwardReverse_OsdShow(_MotorRun_Mode Mode)
{
	switch(Mode)
	{
		case _Foreward:	//正转
			OsdRefresh_Family[_ForwardReverse].Module_addr[0] = osd_Icon_Forward;
			OsdRefresh_Family[_ForwardReverse].Module_addr[1] = '\r';
			break;
		case _Reverse:	//反转
			OsdRefresh_Family[_ForwardReverse].Module_addr[0] = osd_Icon_Reverse;
			OsdRefresh_Family[_ForwardReverse].Module_addr[1] = '\r';
			break;
		case _MotorStop:	//停止
			OsdRefresh_Family[_ForwardReverse].Module_addr[0] = osd_NONE;
			OsdRefresh_Family[_ForwardReverse].Module_addr[1] = '\r';
			break;
		default:
			break;
	}
}

//设置放大倍数图标
void Daylight_AmplifierReduce_OsdShow(_VL_AmplifierReduce_Num Mode)
{
	switch(Mode)
	{
		case _VL_AmplifierReduce_1:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] =osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] =osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_2:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] =osd_2;
		    OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_3:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] =osd_3;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_4:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] =osd_4;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_5:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] =osd_5;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_6:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] =osd_6;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_7:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] =osd_7;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_8:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] =osd_8;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_9:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] =osd_9;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_10:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] = osd_1;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_0;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_11:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] = osd_1;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_1;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_12:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] = osd_1;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_2;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_13:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] = osd_1;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_3;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_14:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] = osd_1;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_4;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_15:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] = osd_1;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_5;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
		case _VL_AmplifierReduce_16:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] = osd_1;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] =osd_6;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
																						

		default:
			OsdRefresh_Family[_VL_Zoom].Module_addr[0] = osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_VL_Zoom].Module_addr[3] = '\r';
			break;
	}
}
void Infrared_AmplifierReduce_OsdShow(_IR_AmplifierReduce_Num Mode)
{
      switch(Mode)
			{
        case _IR_AmplifierReduce_0:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_NONE;
		    OsdRefresh_Family[_IR_Zoom].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[3] = '\r';
			break;

		case _IR_AmplifierReduce_1:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_NONE;
		    OsdRefresh_Family[_IR_Zoom].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[3] = '\r';
    		break;
		case _IR_AmplifierReduce_2:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_2;
		    OsdRefresh_Family[_IR_Zoom].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[3] = '\r';		
			break;
		case _IR_AmplifierReduce_3:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_3;
		    OsdRefresh_Family[_IR_Zoom].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[3] = '\r';		
			break;
		case _IR_AmplifierReduce_4:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_4;
		    OsdRefresh_Family[_IR_Zoom].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[3] = '\r';		
			break;
		case _IR_AmplifierReduce_5:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_5;
		    OsdRefresh_Family[_IR_Zoom].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[3] = '\r';
		    break;
		case _IR_AmplifierReduce_6:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_6;
		    OsdRefresh_Family[_IR_Zoom].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[3] = '\r';
			break;
		case _IR_AmplifierReduce_7:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_7;
		    OsdRefresh_Family[_IR_Zoom].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[3] = '\r';
			break;
		case _IR_AmplifierReduce_8:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_8;
		    OsdRefresh_Family[_IR_Zoom].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[3] = '\r';
			break;
		
	   default:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_NONE;
		    OsdRefresh_Family[_IR_Zoom].Module_addr[2] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[3] = '\r';
			break;
			
			}
}

//OSD展示二级菜单 红外模式配置
void ConfigMenu_IR_OsdShowON(void)
{
	/*二级菜单*/
	//亮度标识
	OsdRefresh_Family[_IR_BrightnessFlag].Refresh_Flag = Refresh_yes;
	
	//亮度值
	OsdRefresh_Family[_IR_Brightness].Refresh_Flag = Refresh_yes;
	
	//对比度标识
	OsdRefresh_Family[_IR_ContrastRatioFlag].Refresh_Flag = Refresh_yes;

	//对比度
	OsdRefresh_Family[_IR_ContrastRatio].Refresh_Flag = Refresh_yes;

	//增强标识
	OsdRefresh_Family[_IR_EnhanceFlag].Refresh_Flag = Refresh_yes;

	//增强值
	OsdRefresh_Family[_IR_Enhance].Refresh_Flag = Refresh_yes;

#if ChengDu	
	//降噪标识
	OsdRefresh_Family[_IR_DNRFlag].Refresh_Flag = Refresh_yes;

	//降噪值
	OsdRefresh_Family[_IR_DNR].Refresh_Flag = Refresh_yes;
#elif BT656 
	//降噪标识
	OsdRefresh_Family[_IR_OutDoorFlag].Refresh_Flag = Refresh_yes;

	//降噪值
	OsdRefresh_Family[_IR_OutDoor].Refresh_Flag = Refresh_yes;
	

#endif
	
	//极性标识
	OsdRefresh_Family[_IR_PolarFlag].Refresh_Flag = Refresh_yes;
	
	//极性值
	OsdRefresh_Family[_IR_Polar].Refresh_Flag = Refresh_yes;
	
	//录像拍照标识
	OsdRefresh_Family[_IR_PRFlag].Refresh_Flag = Refresh_yes;

	//录像拍照值
	OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_yes;
#if WiFi_Flag	
	//Wify标识
	OsdRefresh_Family[_IR_WifiFlag].Refresh_Flag = Refresh_yes;

	//Wify值
	OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_yes;
#endif	
//	//退出
//	OsdRefresh_Family[_IR_Exit].Refresh_Flag = Refresh_yes;
	
	//光标
	OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
}

void ConfigMenu_VL_OsdShowON(void)
{
	static bool Flag_Start=false;
	/*二级菜单*/
	//亮度标识
	
#if 	VL_MC_105Q
	if(Flag_Start == false)
		{ 
			Flag_Start = true;
			
			//亮度初始化
				VL_Bright_Cmd[7] = OsdRefresh_Family[_VL_Brightness].Data * 2;// +1;
				if(VL_Bright_Cmd[7] > 0xf)
				{
					VL_Bright_Cmd[6] = 1;
					VL_Bright_Cmd[7] = VL_Bright_Cmd[7]- 0xf;
				}
				else	
				{
					VL_Bright_Cmd[6] = 0;
				}
				Uart6Send(VL_Bright_Cmd,MyStrlen(VL_Bright_Cmd));
				
			//对比度初始化
				VL_Contract_Cmd[7] = OsdRefresh_Family[_VL_ContrastRatio].Data * 2;
				
				if(VL_Contract_Cmd[7] > 0xf)
				{
					VL_Contract_Cmd[6] = 1;
					VL_Contract_Cmd[7] = VL_Bright_Cmd[7]- 0xf;
				}
				else	
				{
					VL_Contract_Cmd[6] = 0;
				}
				
				Uart6Send(VL_Contract_Cmd,MyStrlen(VL_Contract_Cmd));
     }
#elif 	VL_YT_3578_HD

	if(Flag_Start == false)
		{ 
			Flag_Start = true;
			
			//亮度初始化
				VL_Bright_Cmd[3] = OsdRefresh_Family[_VL_Brightness].Data * 2;// +1;
	
				Uart6Send(VL_Bright_Cmd,MyStrlen(VL_Bright_Cmd));
				
			//对比度初始化
				VL_Contract_Cmd[3] = OsdRefresh_Family[_VL_ContrastRatio].Data * 2;
				

				Uart6Send(VL_Contract_Cmd,MyStrlen(VL_Contract_Cmd));
        }
#endif		 

	OsdRefresh_Family[_VL_BrightnessFlag].Refresh_Flag = Refresh_yes;
	
	//亮度值
	OsdRefresh_Family[_VL_Brightness].Refresh_Flag = Refresh_yes;
	
	//对比度标识
	OsdRefresh_Family[_VL_ContrastRatioFlag].Refresh_Flag = Refresh_yes;

	//对比度
	OsdRefresh_Family[_VL_ContrastRatio].Refresh_Flag = Refresh_yes;

	//模式标识
	OsdRefresh_Family[_VL_ModeFlag].Refresh_Flag = Refresh_yes;

	//模式值
	OsdRefresh_Family[_VL_Mode].Refresh_Flag = Refresh_yes;

	//动态范围标识
	OsdRefresh_Family[_VL_DWDRFlag].Refresh_Flag = Refresh_yes;

	//动态范围值
	OsdRefresh_Family[_VL_DWDR].Refresh_Flag = Refresh_yes;
	
	//降噪标识
	OsdRefresh_Family[_VL_DNRFlag].Refresh_Flag = Refresh_yes;
	
		//降噪值
	OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_yes;

	//录像值
	OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_yes;
	
	//录像标识
	OsdRefresh_Family[_VL_PRFlag].Refresh_Flag = Refresh_yes;

#if WiFi_Flag
	//Wify标识
	OsdRefresh_Family[_VL_WifiFlag].Refresh_Flag = Refresh_yes;

	//Wify值
	OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_yes;
#endif
//	//退出
//	OsdRefresh_Family[_VL_Exit].Refresh_Flag = Refresh_yes;
	
	//光标
	OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;


}

//OSD关闭二级菜单 红外模式下
void ConfigMenu_IR_OsdShowOFF(void)
{
	/*二级菜单*/
	static bool Flag_Start = false;
		if(Flag_Start == false)
		{ 
			Flag_Start = true;
			
			//亮度初始化
#if ChengDu					
			IR_Bright_Cmd[10] = OsdRefresh_Family[_IR_Brightness].Data * 28;
			IR_SumCheck(IR_Bright_Cmd);
			Uart3Send(IR_Bright_Cmd,MyStrlen(IR_Bright_Cmd));
//					DecToHexToAscii(OsdRefresh_Family[_IR_Brightness].Data, 0, OsdRefresh_Family[_IR_Brightness].Module_addr, 1);
//					SmallToBig(OsdRefresh_Family[_IR_Brightness].Module_addr);
	//对比度初始化
			IR_Contract_Cmd[10] = OsdRefresh_Family[_IR_ContrastRatio].Data * 28;
			IR_SumCheck(IR_Contract_Cmd);
			Uart3Send(IR_Contract_Cmd,MyStrlen(IR_Contract_Cmd));
//					DecToHexToAscii(OsdRefresh_Family[_IR_ContrastRatio].Data, 0, OsdRefresh_Family[_IR_ContrastRatio].Module_addr, 1);
//					SmallToBig(OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
#elif BT656
			IR_Bright_Cmd[2] = OsdRefresh_Family[_IR_Brightness].Data * 10;
			IR_SumCheck(IR_Bright_Cmd);
			Uart3Send(IR_Bright_Cmd,MyStrlen(IR_Bright_Cmd));
//					DecToHexToAscii(OsdRefresh_Family[_IR_Brightness].Data, 0, OsdRefresh_Family[_IR_Brightness].Module_addr, 1);
//					SmallToBig(OsdRefresh_Family[_IR_Brightness].Module_addr);
	//对比度初始化
			IR_Contract_Cmd[2] = OsdRefresh_Family[_IR_ContrastRatio].Data * 10;
			IR_SumCheck(IR_Contract_Cmd);
			Uart3Send(IR_Contract_Cmd,MyStrlen(IR_Contract_Cmd));
//					DecToHexToAscii(OsdRefresh_Family[_IR_ContrastRatio].Data, 0, OsdRefresh_Family[_IR_ContrastRatio].Module_addr, 1);
//					SmallToBig(OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
			
#endif
}
	
	//亮度标识
	OsdRefresh_Family[_IR_BrightnessFlag].Refresh_Flag = Refresh_yes;
	
	//亮度值
	OsdRefresh_Family[_IR_Brightness].Refresh_Flag = Refresh_yes;
	
	//对比度标识
	OsdRefresh_Family[_IR_ContrastRatioFlag].Refresh_Flag = Refresh_yes;

	//对比度
	OsdRefresh_Family[_IR_ContrastRatio].Refresh_Flag = Refresh_yes;

	//增强标识
	OsdRefresh_Family[_IR_EnhanceFlag].Refresh_Flag = Refresh_yes;

	//增强值
	OsdRefresh_Family[_IR_Enhance].Refresh_Flag = Refresh_yes;

#if ChengDu
	//降噪标识
	OsdRefresh_Family[_IR_DNRFlag].Refresh_Flag = Refresh_yes;

	//降噪值
	OsdRefresh_Family[_IR_DNR].Refresh_Flag = Refresh_yes;
	
#elif BT656 
	//降噪标识
	OsdRefresh_Family[_IR_OutDoorFlag].Refresh_Flag = Refresh_yes;

	//降噪值
	OsdRefresh_Family[_IR_OutDoor].Refresh_Flag = Refresh_yes;

#endif
	//极性标识
	OsdRefresh_Family[_IR_PolarFlag].Refresh_Flag = Refresh_yes;
	
	//极性值
	OsdRefresh_Family[_IR_Polar].Refresh_Flag = Refresh_yes;
	
	//录像拍照标识
	OsdRefresh_Family[_IR_PRFlag].Refresh_Flag = Refresh_yes;

	//录像拍照值
	OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_yes;

#if WiFi_Flag
	//Wify标识
	OsdRefresh_Family[_IR_WifiFlag].Refresh_Flag = Refresh_yes;

	//Wify值
	OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_yes;
#endif
//	
//	//退出
//	OsdRefresh_Family[_IR_Exit].Refresh_Flag = Refresh_yes;
	
	//光标
	OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
	
	switch(OsdLight_Mode)
	{
		case _Daylight: //这里只是操作屏显示 所以不用发命令给机芯
				DaylightOsdShow();
				break;
		case _Infrared://这里只是操作屏显示 所以不用发命令给机芯
				InfraredOsdShow();
				break;
		default	:
			break;
	}
}


//OSD关闭二级菜单 白光模式下
void ConfigMenu_VL_OsdShowOFF(void)
{
	/*二级菜单*/
	//亮度标识
	OsdRefresh_Family[_VL_BrightnessFlag].Refresh_Flag = Refresh_yes;
	
	//亮度值
	OsdRefresh_Family[_VL_Brightness].Refresh_Flag = Refresh_yes;
	
	//对比度标识
	OsdRefresh_Family[_VL_ContrastRatioFlag].Refresh_Flag = Refresh_yes;

	//对比度
	OsdRefresh_Family[_VL_ContrastRatio].Refresh_Flag = Refresh_yes;

	//模式标识
	OsdRefresh_Family[_VL_ModeFlag].Refresh_Flag = Refresh_yes;

	//模式值
	OsdRefresh_Family[_VL_Mode].Refresh_Flag = Refresh_yes;

	//动态范围标识
	OsdRefresh_Family[_VL_DWDRFlag].Refresh_Flag = Refresh_yes;

	//动态范围值
	OsdRefresh_Family[_VL_DWDR].Refresh_Flag = Refresh_yes;
	
	//降噪标识
	OsdRefresh_Family[_VL_DNRFlag].Refresh_Flag = Refresh_yes;
	
		//降噪值
	OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_yes;

	//录像值
	OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_yes;
	
	//录像标识
	OsdRefresh_Family[_VL_PRFlag].Refresh_Flag = Refresh_yes;

#if WiFi_Flag
	//Wify标识
	OsdRefresh_Family[_VL_WifiFlag].Refresh_Flag = Refresh_yes;

	//Wify值
	OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_yes;
#endif
//	
//	//退出
//	OsdRefresh_Family[_VL_Exit].Refresh_Flag = Refresh_yes;
	
	//光标
	OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
	
	switch(OsdLight_Mode)
	{
		case _Daylight: //这里只是操作屏显示 所以不用发命令给机芯
				DaylightOsdShow();
				break;
		case _Infrared://这里只是操作屏显示 所以不用发命令给机芯
				InfraredOsdShow();
				break;
		default	:
			break;
	}
}

//OSD关闭二级菜单 白光模式下
void ConfigMenu_OsdShowOFF(void)
{
	/*二级菜单*/
	//亮度标识
	OsdRefresh_Family[_IR_Brightness].Refresh_Flag = Refresh_no;
	
	//亮度值
	OsdRefresh_Family[_IR_BrightnessFlag].Refresh_Flag = Refresh_no;
	
	//对比度标识
	OsdRefresh_Family[_IR_ContrastRatio].Refresh_Flag = Refresh_no;

	//对比度
	OsdRefresh_Family[_IR_ContrastRatioFlag].Refresh_Flag = Refresh_no;
	
	//模式标识
	OsdRefresh_Family[_IR_Enhance].Refresh_Flag = Refresh_no;

	//模式
	OsdRefresh_Family[_IR_EnhanceFlag].Refresh_Flag = Refresh_no;
	
#if ChengDu
	//降噪标识
	OsdRefresh_Family[_IR_DNRFlag].Refresh_Flag = Refresh_no;

	//降噪值
	OsdRefresh_Family[_IR_DNR].Refresh_Flag = Refresh_no;
	
#elif BT656 
	//降噪标识
	OsdRefresh_Family[_IR_OutDoorFlag].Refresh_Flag = Refresh_no;

	//降噪值
	OsdRefresh_Family[_IR_OutDoor].Refresh_Flag = Refresh_no;
	

#endif

	//降噪标识
	OsdRefresh_Family[_IR_Polar].Refresh_Flag = Refresh_no;

	//降噪
	OsdRefresh_Family[_IR_PolarFlag].Refresh_Flag = Refresh_no;
	
	//录像标识
	OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_no;
	//录像值
	OsdRefresh_Family[_IR_PRFlag].Refresh_Flag = Refresh_no;

#if WiFi_Flag
	//Wifi标识
	OsdRefresh_Family[_IR_WifiFlag].Refresh_Flag = Refresh_no;

	//Wifi值
	OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_no;
#endif	
	
//	//退出
//	OsdRefresh_Family[_VL_Exit].Refresh_Flag = Refresh_no;
	
	//光标
	OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_no;
	
	
//==================================================================================//	
	//亮度标识
	OsdRefresh_Family[_VL_BrightnessFlag].Refresh_Flag = Refresh_no;
	
	//亮度值
	OsdRefresh_Family[_VL_Brightness].Refresh_Flag = Refresh_no;
	
	//对比度标识
	OsdRefresh_Family[_VL_ContrastRatioFlag].Refresh_Flag = Refresh_no;

	//对比度
	OsdRefresh_Family[_VL_ContrastRatio].Refresh_Flag = Refresh_no;
	
	//模式标识
	OsdRefresh_Family[_VL_ModeFlag].Refresh_Flag = Refresh_no;

	//模式
	OsdRefresh_Family[_VL_Mode].Refresh_Flag = Refresh_no;
	
	//动态范围标识
	OsdRefresh_Family[_VL_DWDRFlag].Refresh_Flag = Refresh_no;

	//动态范围
	OsdRefresh_Family[_VL_DWDR].Refresh_Flag = Refresh_no;

	//降噪标识
	OsdRefresh_Family[_VL_DNRFlag].Refresh_Flag = Refresh_no;

	//降噪
	OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_no;
	
	//录像标识
	OsdRefresh_Family[_VL_PRFlag].Refresh_Flag = Refresh_no;
	//录像值
	OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_no;

#if WiFi_Flag
	//Wifi标识
	OsdRefresh_Family[_VL_WifiFlag].Refresh_Flag = Refresh_no;

	//Wifi值
	OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_no;
#endif	
	
//	//退出
//	OsdRefresh_Family[_VL_Exit].Refresh_Flag = Refresh_no;
	
	//光标
	OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_no;
	
	switch(OsdLight_Mode)
	{
		case _Daylight: //这里只是操作屏显示 所以不用发命令给机芯
				DaylightOsdShow();
				break;
		case _Infrared://这里只是操作屏显示 所以不用发命令给机芯
				InfraredOsdShow();
				break;
		default	:
			break;
	}
}


//光标下移
void CursorDown(_ConfigMenuPra *ConfigMenuPra)
{
		_Bool CursorQueueData;
	
		if(OsdLight_Mode == _Infrared)
		{

			switch(*ConfigMenuPra)
			{
			case _IR_Brightness :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_BrightnessFlag_Module_local[0]; //改光标位置行
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _IR_ContrastRatio :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_ContrastRatioFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _IR_Enhance :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_EnhanceFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
#if ChengDu			
			case _IR_DNR :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_DNRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);
				break;
#elif BT656 
			case _IR_OutDoor :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_OutDoorFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);
				break;

#endif			
			
			case _IR_Polar :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_PolarFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _IR_PR :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_PRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
#if WiFi_Flag			
			case _IR_Wifi:
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_Wifi_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;					//退出
#endif			
			//退出
	
//			case _IR_Exit:
//				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_Exit_Module_local[0]; //改光标位置
//				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
//				CursorQueueData = true;
//				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
//				break;
						
//			case _IR_Cursor:
//				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_Cursor_Module_local[0]; //改光标位置
//				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
//				//*ConfigMenuPra=_Brightness;
//				CursorQueueData = true;
//				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
//				break;
			
			default:
				*ConfigMenuPra = _IR_Brightness;
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_BrightnessFlag_Module_local[0]; //改光标位置行
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			}
		}
	
		else if(OsdLight_Mode == _Daylight)
		{
			switch(*ConfigMenuPra)
			{
			case _VL_Brightness :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_BrightnessFlag_Module_local[0]; //改光标位置行
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _VL_ContrastRatio :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_ContrastRatioFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _VL_Mode :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_ModeFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
//			case _Pip :
//				OsdRefresh_Family[_Cursor].Module_local[0] = PipFlag_Module_local[0]; //改光标位置
//				OsdRefresh_Family[_Cursor].Refresh_Flag = Refresh_yes;
//				//*ConfigMenuPra+=2;
//				CursorQueueData = true;
//				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);
				break;
			
			case _VL_DWDR :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_DWDRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				//*ConfigMenuPra+=2;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);
				break;
			
			case _VL_DNR :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_DNRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _VL_PR :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_PRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
#if WiFi_Flag			
			case _VL_Wifi:
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_WifiFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
#endif	
			
//			case _VL_Exit:
//				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_Exit_Module_local[0]; //改光标位置
//				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
//				CursorQueueData = true;
//				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
//				break;
//			case _VL_Cursor:
//				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_Cursor_Module_local[0]; //改光标位置
//				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
//				//*ConfigMenuPra=_Brightness;
//				CursorQueueData = true;
//				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
//				break;
			default:
				*ConfigMenuPra = _VL_Brightness;
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_BrightnessFlag_Module_local[0]; //改光标位置行
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
		}
	}
}

//光标上移
void CursorUp(_ConfigMenuPra *ConfigMenuPra)
{
		_Bool CursorQueueData;
	
		if(OsdLight_Mode == _Infrared)
		{

			switch(*ConfigMenuPra)
			{
			case _IR_Brightness :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_BrightnessFlag_Module_local[0]; //改光标位置行
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _IR_ContrastRatio :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_ContrastRatioFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _IR_Enhance :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_EnhanceFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
#if ChengDu 
			case _IR_DNR :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_DNRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);
				break;
#elif BT656 
			case _IR_OutDoor :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_OutDoorFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);
				break;
#endif			
			
			case _IR_Polar :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_PolarFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _IR_PR :
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_PRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
#if WiFi_Flag			
			case _IR_Wifi:
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_WifiFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			default:
				*ConfigMenuPra = _IR_Wifi;
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_WifiFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData =true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
			break;
#else
			default:
				*ConfigMenuPra = _IR_PR;
				OsdRefresh_Family[_IR_Cursor].Module_local[0] = IR_PRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_IR_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData =true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
            break;
#endif	
			}
		}
	
		else if(OsdLight_Mode == _Daylight)
		{
			switch(*ConfigMenuPra)
			{
			case _VL_Brightness :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_BrightnessFlag_Module_local[0]; //改光标位置行
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _VL_ContrastRatio :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_ContrastRatioFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _VL_Mode :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_ModeFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _VL_DWDR :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_DWDRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);
				break;
			
			case _VL_DNR :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_DNRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
			case _VL_PR :
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_PRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			
#if WiFi_Flag			
			case _VL_Wifi:
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_WifiFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData = true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
				break;
			default:
				*ConfigMenuPra = _VL_Wifi;
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_WifiFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData =true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
                break;			
			
#else
			default:
				*ConfigMenuPra = _VL_PR;
				OsdRefresh_Family[_VL_Cursor].Module_local[0] = VL_PRFlag_Module_local[0]; //改光标位置
				OsdRefresh_Family[_VL_Cursor].Refresh_Flag = Refresh_yes;
				CursorQueueData =true;
				xQueueSend(Cursor_QueueHandle,&CursorQueueData,0);//
			break;

#endif			
		}
			
	}
}

 
//字符串转换成十进制数 最大99
uint8_t StrTODec(uint8_t *Str_Data)
{
	uint8_t Data1,Data2,Ret;

	if(*Str_Data > 0x30 && *Str_Data <= 0x39)
		Data1 = Str_Data[0]-0x30;
	else
		Data1 = 0;
	
	if(Str_Data[1] > 0x30 && Str_Data[1] <= 0x39)
		Data2 = (Str_Data[1]-0x30)*10;
	else
		Data2 = 0;
	
	Ret = Data1 + Data2;
	return	Ret;
}

#define  Brightness_step  1;
#define  ContrastRatio_step  1;
#define  Enhance_step  1;
//光标右移 更改参数值+ ***************************************************************************************
void CursorRight(_ConfigMenuPra *ConfigMenuPra)
{
	uint8_t Temp_IR_Brightness;
	uint8_t Temp_IR_ContrastRatio;
	uint8_t Temp_IR_Enhance;
		//红外
		if(OsdLight_Mode == _Infrared)
		{
			switch(*ConfigMenuPra)
			{
				case _IR_Brightness :
#if ChengDu					
				if(OsdRefresh_Family[_IR_Brightness].Data < 9)
					OsdRefresh_Family[_IR_Brightness].Data += Brightness_step;
				
				IR_Bright_Cmd[10] = OsdRefresh_Family[_IR_Brightness].Data * 28;
				IR_SumCheck(IR_Bright_Cmd);
				
				Uart3Send(IR_Bright_Cmd,MyStrlen(IR_Bright_Cmd));
				DecToHexToAscii(OsdRefresh_Family[_IR_Brightness].Data, 0, OsdRefresh_Family[_IR_Brightness].Module_addr, 1);
				SmallToBig(OsdRefresh_Family[_IR_Brightness].Module_addr);
				OsdRefresh_Family[_IR_Brightness].Refresh_Flag = Refresh_yes;
				break;
#elif BT656
				if(OsdRefresh_Family[_IR_Brightness].Data < 9)
					OsdRefresh_Family[_IR_Brightness].Data += Brightness_step;
				
				IR_Bright_Cmd[2] = OsdRefresh_Family[_IR_Brightness].Data * 10;
				IR_SumCheck(IR_Bright_Cmd);
				
				Uart3Send(IR_Bright_Cmd,MyStrlen(IR_Bright_Cmd));
				DecToHexToAscii(OsdRefresh_Family[_IR_Brightness].Data, 0, OsdRefresh_Family[_IR_Brightness].Module_addr, 1);
				SmallToBig(OsdRefresh_Family[_IR_Brightness].Module_addr);
				OsdRefresh_Family[_IR_Brightness].Refresh_Flag = Refresh_yes;
				break;
				
#endif
				
				case _IR_ContrastRatio :
					if(OsdRefresh_Family[_IR_ContrastRatio].Data < 9)
						OsdRefresh_Family[_IR_ContrastRatio].Data += Brightness_step;
#if ChengDu					
					
					IR_Contract_Cmd[10] = OsdRefresh_Family[_IR_ContrastRatio].Data * 28;
					IR_SumCheck(IR_Contract_Cmd);
					Uart3Send(IR_Contract_Cmd,MyStrlen(IR_Contract_Cmd));
					DecToHexToAscii(OsdRefresh_Family[_IR_ContrastRatio].Data, 0, OsdRefresh_Family[_IR_ContrastRatio].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
					OsdRefresh_Family[_IR_ContrastRatio].Refresh_Flag = Refresh_yes;
#elif BT656
					IR_Contract_Cmd[2] = OsdRefresh_Family[_IR_ContrastRatio].Data * 10;
					IR_SumCheck(IR_Contract_Cmd);
					Uart3Send(IR_Contract_Cmd,MyStrlen(IR_Contract_Cmd));
					DecToHexToAscii(OsdRefresh_Family[_IR_ContrastRatio].Data, 0, OsdRefresh_Family[_IR_ContrastRatio].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
					OsdRefresh_Family[_IR_ContrastRatio].Refresh_Flag = Refresh_yes;
					
#endif					
					break;
				
				case _IR_Enhance :
					
					
					
#if ChengDu					
					if(OsdRefresh_Family[_IR_Enhance].Data < 9)
						OsdRefresh_Family[_IR_Enhance].Data += Brightness_step;
					IR_DDEBase_Cmd[10] = (OsdRefresh_Family[_IR_Enhance].Data*20 & 0xff );//基图
					IR_DDEBase_Cmd[11] = (OsdRefresh_Family[_IR_Enhance].Data*20 >> 8 ) & 0xff ;//基图
					IR_SumCheck(IR_DDEBase_Cmd);
					Uart3Send(IR_DDEBase_Cmd,MyStrlen(IR_DDEBase_Cmd));
					
					IR_DDE_Cmd[0] = (OsdRefresh_Family[_IR_Enhance].Data*20*2) ;//
					IR_DDEBase_Cmd[10] = (OsdRefresh_Family[_IR_Enhance].Data*20*2 & 0xff );//基图
					IR_DDEBase_Cmd[11] = (OsdRefresh_Family[_IR_Enhance].Data*20*2 >> 8 ) & 0xff ;//基图
					IR_SumCheck(IR_DDE_Cmd);
					Uart3Send(IR_DDEBase_Cmd,MyStrlen(IR_DDEBase_Cmd));
#elif BT656
				     if(OsdRefresh_Family[_IR_Enhance].Data < 7)
						OsdRefresh_Family[_IR_Enhance].Data += Brightness_step;
					IR_DDE_Cmd[2] = (OsdRefresh_Family[_IR_Enhance].Data);//基图
					IR_SumCheck(IR_DDE_Cmd);
					Uart3Send(IR_DDE_Cmd,MyStrlen(IR_DDE_Cmd));
					
					
#endif							

					DecToHexToAscii(OsdRefresh_Family[_IR_Enhance].Data, 0, OsdRefresh_Family[_IR_Enhance].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_IR_Enhance].Module_addr);
					OsdRefresh_Family[_IR_Enhance].Refresh_Flag = Refresh_yes;


					break;
#if ChengDu 					
				case _IR_DNR :
					
					if(OsdRefresh_Family[_IR_DNR].Data < 7)
						OsdRefresh_Family[_IR_DNR].Data += Brightness_step;
					
					IR_DNR_Cmd[10] = OsdRefresh_Family[_IR_DNR].Data * 2;
					IR_SumCheck(IR_Contract_Cmd);
					Uart3Send(IR_DNR_Cmd,MyStrlen(IR_DNR_Cmd));
					DecToHexToAscii(OsdRefresh_Family[_IR_DNR].Data, 0, OsdRefresh_Family[_IR_DNR].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_IR_DNR].Module_addr);
					OsdRefresh_Family[_IR_DNR].Refresh_Flag = Refresh_yes;


					break;
#elif BT656
	                case _IR_OutDoor :
						if(OsdRefresh_Family[_IR_OutDoor].Data != _OutDoor_On)
						{
						 OutDoor_Pra = _OutDoor_On;
						 Set_Osd_OutDoor(OutDoor_Pra);	
			             Uart3Send(IR_OutDoor_ON_Cmd,MyStrlen(IR_OutDoor_ON_Cmd));
						 OsdRefresh_Family[_IR_OutDoor].Data += Brightness_step;
						 OsdRefresh_Family[_IR_OutDoor].Refresh_Flag = Refresh_yes;

						}

					

					break;
							
				
#endif					

				case _IR_Polar :
					if(OsdRefresh_Family[_IR_Polar].Data < _GreenHot)
						OsdRefresh_Family[_IR_Polar].Data += 1;
					
						switch(OsdRefresh_Family[_IR_Polar].Data)
						{
								case _WhiteHot:
									if(Osd_Infrared_ColorMode == _WhiteHot)
									{
										break;
									}
									Osd_Infrared_ColorMode = _WhiteHot;
									Uart3Send(IR_Polar_WHot_Cmd,MyStrlen(IR_Polar_WHot_Cmd));
									break;
								case _BlackHot:
									Osd_Infrared_ColorMode = _BlackHot;
									Uart3Send(IR_Polar_BHot_Cmd,MyStrlen(IR_Polar_BHot_Cmd));
									break;
#if ChengDu 							
							case _Rainbow:
								Osd_Infrared_ColorMode = _Rainbow;
								//关闭条纹降噪
//								IR_BT656_StripeDenoising_Cmd[10] = 0x00;
//								IR_SumCheck(IR_BT656_StripeDenoising_Cmd);
//								Uart3Send(IR_BT656_StripeDenoising_Cmd,MyStrlen(IR_BT656_StripeDenoising_Cmd));
								//开启rainbow模式
								Uart3Send(IR_Polar_RainBow_Cmd,MyStrlen(IR_Polar_RainBow_Cmd));
								break;
#elif BT656
							
							
#endif
								case _Iron:
									Osd_Infrared_ColorMode = _Iron;
									Uart3Send(IR_Polar_Iron_Cmd,MyStrlen(IR_Polar_Iron_Cmd));
									break;
								case _GreenHot:
									if(Osd_Infrared_ColorMode == _GreenHot)
									{
										break;
									}
									Osd_Infrared_ColorMode = _GreenHot;
									Uart3Send(IR_Polar_Green_Cmd,MyStrlen(IR_Polar_Green_Cmd));
									break;
								default:
									break;					
						}
					
					OsdRefresh_Family[_IR_Polar].Refresh_Flag = Refresh_yes;
					Set_Osd_Infrared_ColorMode(Osd_Infrared_ColorMode);
							
					OsdRefresh_Family[_Infrared_ColorMode].Refresh_Flag = Refresh_yes;

					break;
							
				case _IR_PR ://录像拍照
					if(OsdRefresh_Family[_IR_PR].Data <	1)
					{
						//一级菜单图标显示
						OsdRun_Mode = _PhotoMode;//开启拍照录像功能默认拍照
						Set_Osd_PhotoRecord(OsdRun_Mode);
						OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_yes;
						
						//配置菜单图标显示
//						OsdRefresh_Family[_IR_PR].Data += 1;
//						OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_yes;
//						OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_yes;
						
						
						OsdRefresh_Family[_IR_PR].Data += 1;
						OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_yes;
						OsdRefresh_Family[_VL_PR].Data += 1;
						OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_yes;
						Flag_PhotoRecordeEnable = TRUE;
					}

					break;
				
#if WiFi_Flag				
				case _IR_Wifi :
					Wifi_ON();
					if(OsdRefresh_Family[_IR_Wifi].Data < 1)
					{
						//一级菜单图标显示
						WIFI_Mode = _WIFI_ON;
						Set_Osd_Wifi(WIFI_Mode);
						OsdRefresh_Family[_Wifi].Refresh_Flag = Refresh_yes;
						
						//配置菜单图标显示
						OsdRefresh_Family[_IR_Wifi].Data += Brightness_step;
						OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_yes;
						OsdRefresh_Family[_VL_Wifi].Module_addr[2] = '\r';
						OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_yes;
					}

					break;
#endif

					break;
//				
//				case _IR_Exit :

//					break;
				
				default:
					
					break;
			}
		
		}
		
		
		//白光
		else if(OsdLight_Mode == _Daylight)
		{
			switch(*ConfigMenuPra)
			{
				case _VL_Brightness :
					if(OsdRefresh_Family[_VL_Brightness].Data < 9)
						OsdRefresh_Family[_VL_Brightness].Data += Brightness_step;

#if  VL_MC_105Q
					
		 VL_Bright_Cmd[7] = OsdRefresh_Family[_VL_Brightness].Data * 2;// +1;
					
					if(VL_Bright_Cmd[7] > 0xf)
					{
						VL_Bright_Cmd[6] = 1;
						VL_Bright_Cmd[7] = VL_Bright_Cmd[7]- 0xf;
					}
					else	
					{
						VL_Bright_Cmd[6] = 0;
					}
					
#elif  VL_YT_3578_HD

		 VL_Bright_Cmd[3] = OsdRefresh_Family[_VL_Brightness].Data * 2;// +1;
					

#endif						
			
					Uart6Send(VL_Bright_Cmd,MyStrlen(VL_Bright_Cmd));
					
					DecToHexToAscii(OsdRefresh_Family[_VL_Brightness].Data, 0, OsdRefresh_Family[_VL_Brightness].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_VL_Brightness].Module_addr);
					OsdRefresh_Family[_VL_Brightness].Refresh_Flag = Refresh_yes;

					break;
				
				case _VL_ContrastRatio :
					if(OsdRefresh_Family[_VL_ContrastRatio].Data < 9)
						OsdRefresh_Family[_VL_ContrastRatio].Data += Brightness_step;
					
#if  VL_MC_105Q
					
		 VL_Contract_Cmd[7] = OsdRefresh_Family[_VL_ContrastRatio].Data * 2;// +1;
					
					if(VL_Contract_Cmd[7] > 0xf)
					{
						VL_Contract_Cmd[6] = 1;
						VL_Contract_Cmd[7] = VL_Contract_Cmd[7]- 0xf;
					}
					else	
					{
						VL_Contract_Cmd[6] = 0;
					}
					
					Uart6Send(VL_Contract_Cmd,MyStrlen(VL_Contract_Cmd));
										
#elif  VL_YT_3578_HD

		 VL_Contract_Cmd[3] = OsdRefresh_Family[_VL_ContrastRatio].Data * 2;// +1;
					
		 Uart6Send(VL_Contract_Cmd,MyStrlen(VL_Contract_Cmd));

#endif						
				
					
					DecToHexToAscii(OsdRefresh_Family[_VL_ContrastRatio].Data, 0, OsdRefresh_Family[_VL_ContrastRatio].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_VL_ContrastRatio].Module_addr);
					OsdRefresh_Family[_VL_ContrastRatio].Refresh_Flag = Refresh_yes;

					break;
					
					case _VL_Mode :
					if(OsdRefresh_Family[_VL_Mode].Data < _Night)
						OsdRefresh_Family[_VL_Mode].Data += 1;
					
					switch(OsdRefresh_Family[_VL_Mode].Data)
					{
						case _Auto:
							Osd_Daylight_ColorMode = _Auto;
							Uart6Send(VL_Mode_Defog_OFF_Cmd,MyStrlen(VL_Mode_Defog_OFF_Cmd));
							Uart6Send(VL_Mode_Auto_Cmd,MyStrlen(VL_Mode_Auto_Cmd));
							break;
						case _Day:
							Osd_Daylight_ColorMode = _Day;
							Uart6Send(VL_Mode_Defog_OFF_Cmd,MyStrlen(VL_Mode_Defog_OFF_Cmd));
							Uart6Send(VL_Mode_Day_Cmd,MyStrlen(VL_Mode_Day_Cmd));
							break;
						case _Defog_Low:
							Osd_Daylight_ColorMode = _Defog_Low;
							Uart6Send(VL_Mode_Defog_ON_Cmd,MyStrlen(VL_Mode_Defog_ON_Cmd));
							Uart6Send(VL_Mode_Defog_Low_Cmd,MyStrlen(VL_Mode_Defog_Low_Cmd));
							break;
						
						case _Defog_Mid:
							Osd_Daylight_ColorMode = _Defog_Mid;
							Uart6Send(VL_Mode_Defog_ON_Cmd,MyStrlen(VL_Mode_Defog_ON_Cmd));
							Uart6Send(VL_Mode_Defog_Mid_Cmd,MyStrlen(VL_Mode_Defog_Mid_Cmd));
							break;
						case _Defog_Hig:
							Osd_Daylight_ColorMode = _Defog_Hig;
							Uart6Send(VL_Mode_Defog_ON_Cmd,MyStrlen(VL_Mode_Defog_ON_Cmd));
							Uart6Send(VL_Mode_Defog_Hig_Cmd,MyStrlen(VL_Mode_Defog_Hig_Cmd));
							break;
						case _Night:
							Osd_Daylight_ColorMode = _Night;
							Uart6Send(VL_Mode_Defog_OFF_Cmd,MyStrlen(VL_Mode_Defog_OFF_Cmd));
							Uart6Send(VL_Mode_Night_Cmd,MyStrlen(VL_Mode_Night_Cmd));
							break;
						default:
							Osd_Daylight_ColorMode = _Auto;
							OsdRefresh_Family[_VL_Mode].Data = 0;
							Uart6Send(VL_Mode_Defog_OFF_Cmd,MyStrlen(VL_Mode_Defog_OFF_Cmd));
							Uart6Send(VL_Mode_Auto_Cmd,MyStrlen(VL_Mode_Auto_Cmd));
							break;					
					}
					
					Set_Osd_Daylight_ColorMode(Osd_Daylight_ColorMode);
					OsdRefresh_Family[_Daylight_ColorMode].Refresh_Flag = Refresh_yes;
					OsdRefresh_Family[_VL_Mode].Refresh_Flag = Refresh_yes;

					break;

				case _VL_DWDR :
#if  VL_MC_105Q
					if(OsdRefresh_Family[_VL_DWDR].Data < _DWR_Hig)
					 OsdRefresh_Family[_VL_DWDR].Data += 1;
						switch(OsdRefresh_Family[_VL_DWDR].Data)
						{
								case _DWR_Off:
									DWR_Pra = _DWR_Off;
									Uart6Send((uint8_t*)VL_DWDR_Off_Cmd,MyStrlen(VL_DWDR_Off_Cmd));
									break;
								case _DWR_Low:
									DWR_Pra = _DWR_Low;
									Uart6Send((uint8_t*)VL_DWDR_On_Cmd,MyStrlen(VL_DWDR_On_Cmd));
									Uart6Send((uint8_t*)VL_DWDR_AutoMode_Cmd,MyStrlen(VL_DWDR_AutoMode_Cmd));
									Uart6Send((uint8_t*)VL_DWDR_Low_Cmd,MyStrlen(VL_DWDR_Low_Cmd));
									break;
								case _DWR_Mid:
									DWR_Pra = _DWR_Mid;
									Uart6Send((uint8_t*)VL_DWDR_On_Cmd,MyStrlen(VL_DWDR_On_Cmd));
									Uart6Send((uint8_t*)VL_DWDR_AutoMode_Cmd,MyStrlen(VL_DWDR_AutoMode_Cmd));
									Uart6Send((uint8_t*)VL_DWDR_Mid_Cmd,MyStrlen(VL_DWDR_Mid_Cmd));
									break;
								case _DWR_Hig:
									DWR_Pra = _DWR_Hig;
									Uart6Send((uint8_t*)VL_DWDR_On_Cmd,MyStrlen(VL_DWDR_On_Cmd));
									Uart6Send((uint8_t*)VL_DWDR_AutoMode_Cmd,MyStrlen(VL_DWDR_AutoMode_Cmd));
									Uart6Send((uint8_t*)VL_DWDR_Hig_Cmd,MyStrlen(VL_DWDR_Hig_Cmd));
									break;
								default:
									break;					
							}
												
#elif   VL_YT_3578_HD
                     if(OsdRefresh_Family[_VL_DWDR].Data < _DWR_Hig)
						 OsdRefresh_Family[_VL_DWDR].Data += 1;
							switch(OsdRefresh_Family[_VL_DWDR].Data)
							{
									case _DWR_Low:
										DWR_Pra = _DWR_Low;
										Uart6Send((uint8_t*)VL_DWDR_Low_Cmd,MyStrlen(VL_DWDR_Low_Cmd));
										break;
									case _DWR_Mid:
										DWR_Pra = _DWR_Mid;
										Uart6Send((uint8_t*)VL_DWDR_Mid_Cmd,MyStrlen(VL_DWDR_Mid_Cmd));
										break;
									case _DWR_Hig:
										DWR_Pra = _DWR_Hig;
										Uart6Send((uint8_t*)VL_DWDR_Hig_Cmd,MyStrlen(VL_DWDR_Hig_Cmd));
										break;
									default:
										break;					
							}
							
#endif				
					OsdRefresh_Family[_VL_DWDR].Refresh_Flag = Refresh_yes;
					//设置白光模式下的动态范围
					Set_Osd_Daylight_DWDR(DWR_Pra);


					break;
							
				case _VL_DNR ://降噪
#if VL_MC_105Q

					if(OsdRefresh_Family[_VL_DNR].Data < 7)
						OsdRefresh_Family[_VL_DNR].Data += 1;
					
					VL_DNR_Cmd[4] = OsdRefresh_Family[_VL_DNR].Data * 2;
					
					Uart6Send(VL_DNR_Cmd,MyStrlen(VL_DNR_Cmd));
					
					DecToHexToAscii(OsdRefresh_Family[_VL_DNR].Data, 0, OsdRefresh_Family[_VL_DNR].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_VL_DNR].Module_addr);
					OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_yes;
					break;
				
#elif VL_YT_3578_HD
				
				  if(OsdRefresh_Family[_VL_DNR].Data < _DNR_Hig)
						 OsdRefresh_Family[_VL_DNR].Data += 1;
							switch(OsdRefresh_Family[_VL_DNR].Data)
							{
									case _DNR_Off:
										DNR_Pra = _DNR_Off;
										Uart6Send((uint8_t*)VL_DNR_Off_Cmd,MyStrlen(VL_DNR_Off_Cmd));
										break;								
								
									case _DNR_Low:
										DNR_Pra = _DNR_Low;
										Uart6Send((uint8_t*)VL_DNR_Low_Cmd,MyStrlen(VL_DNR_Low_Cmd));
										break;
									case _DNR_Mid:
										DNR_Pra = _DNR_Mid;
										Uart6Send((uint8_t*)VL_DNR_Mid_Cmd,MyStrlen(VL_DNR_Mid_Cmd));
										break;
									case _DNR_Hig:
										DNR_Pra = _DNR_Hig;
										Uart6Send((uint8_t*)VL_DNR_Hig_Cmd,MyStrlen(VL_DNR_Hig_Cmd));
										break;
									default:
										break;					
							}

					OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_yes;
					//设置白光模式下的动态范围
					Set_Osd_Daylight_DNR(DNR_Pra);


					break;
#endif				
				case _VL_PR ://录像拍照
					
					if(OsdRefresh_Family[_VL_PR].Data <	1)
					{
						//一级菜单图标显示
						OsdRun_Mode = _PhotoMode;//开启拍照录像功能默认拍照
						Set_Osd_PhotoRecord(OsdRun_Mode);
						OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_yes;
						
						//配置菜单图标显示
//						OsdRefresh_Family[_VL_PR].Data += 1;
//						OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_yes;
//						OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_yes;
						
						OsdRefresh_Family[_IR_PR].Data += 1;
						OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_yes;
						OsdRefresh_Family[_VL_PR].Data += 1;
						OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_yes;
						Flag_PhotoRecordeEnable = TRUE;
					}

					break;
				
#if WiFi_Flag				
				case _VL_Wifi :
					Wifi_ON();
					if(OsdRefresh_Family[_VL_Wifi].Data < 1)
					{
						//一级菜单图标显示
						WIFI_Mode = _WIFI_ON;
						Set_Osd_Wifi(WIFI_Mode);
						OsdRefresh_Family[_Wifi].Refresh_Flag = Refresh_yes;
						
						//配置菜单图标显示
						OsdRefresh_Family[_VL_Wifi].Data += 1;
						OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_yes;
						OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_yes;
					}

					break;
#endif	

//					break;
				
//				case _IR_Exit :

//					break;
				
				default:
					
					break;
			}
				
		}
			
	}




	
//光标左移 更改参数值
void CursorLeft(_ConfigMenuPra *ConfigMenuPra)
{
	uint8_t Temp_IR_Brightness;
	uint8_t Temp_IR_ContrastRatio;
	uint8_t Temp_IR_Enhance;
		//红外
		if(OsdLight_Mode == _Infrared)
		{
			switch(*ConfigMenuPra)
			{
				case _IR_Brightness :
					
					
					
#if ChengDu					
				if(OsdRefresh_Family[_IR_Brightness].Data > 1)
						OsdRefresh_Family[_IR_Brightness].Data -= Brightness_step;
				
				IR_Bright_Cmd[10] = OsdRefresh_Family[_IR_Brightness].Data * 28;
				IR_SumCheck(IR_Bright_Cmd);
				
				Uart3Send(IR_Bright_Cmd,MyStrlen(IR_Bright_Cmd));
				DecToHexToAscii(OsdRefresh_Family[_IR_Brightness].Data, 0, OsdRefresh_Family[_IR_Brightness].Module_addr, 1);
				SmallToBig(OsdRefresh_Family[_IR_Brightness].Module_addr);
				OsdRefresh_Family[_IR_Brightness].Refresh_Flag = Refresh_yes;
				break;
#elif BT656
				if(OsdRefresh_Family[_IR_Brightness].Data > 1)
				   OsdRefresh_Family[_IR_Brightness].Data -= Brightness_step;
				
				IR_Bright_Cmd[2] = OsdRefresh_Family[_IR_Brightness].Data * 10;
				IR_SumCheck(IR_Bright_Cmd);
				
				Uart3Send(IR_Bright_Cmd,MyStrlen(IR_Bright_Cmd));
				DecToHexToAscii(OsdRefresh_Family[_IR_Brightness].Data, 0, OsdRefresh_Family[_IR_Brightness].Module_addr, 1);
				SmallToBig(OsdRefresh_Family[_IR_Brightness].Module_addr);
				OsdRefresh_Family[_IR_Brightness].Refresh_Flag = Refresh_yes;
				break;
				
#endif
					break;
				
				case _IR_ContrastRatio :
					if(OsdRefresh_Family[_IR_ContrastRatio].Data > 1)
						OsdRefresh_Family[_IR_ContrastRatio].Data -= Brightness_step;
#if ChengDu					
					
					IR_Contract_Cmd[10] = OsdRefresh_Family[_IR_ContrastRatio].Data * 28;
					IR_SumCheck(IR_Contract_Cmd);
					Uart3Send(IR_Contract_Cmd,MyStrlen(IR_Contract_Cmd));
					DecToHexToAscii(OsdRefresh_Family[_IR_ContrastRatio].Data, 0, OsdRefresh_Family[_IR_ContrastRatio].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
					OsdRefresh_Family[_IR_ContrastRatio].Refresh_Flag = Refresh_yes;
#elif BT656
					IR_Contract_Cmd[2] = OsdRefresh_Family[_IR_ContrastRatio].Data * 10;
					IR_SumCheck(IR_Contract_Cmd);
					Uart3Send(IR_Contract_Cmd,MyStrlen(IR_Contract_Cmd));
					DecToHexToAscii(OsdRefresh_Family[_IR_ContrastRatio].Data, 0, OsdRefresh_Family[_IR_ContrastRatio].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_IR_ContrastRatio].Module_addr);
					OsdRefresh_Family[_IR_ContrastRatio].Refresh_Flag = Refresh_yes;
					
#endif	
					break;
				
				case _IR_Enhance :
#if	ChengDu				
					if(OsdRefresh_Family[_IR_Enhance].Data > 1)
						OsdRefresh_Family[_IR_Enhance].Data -= Brightness_step;
					
					IR_DDEBase_Cmd[10] = (OsdRefresh_Family[_IR_Enhance].Data*20 & 0xff );//基图
					IR_DDEBase_Cmd[11] = (OsdRefresh_Family[_IR_Enhance].Data*20 >> 8 ) & 0xff ;//基图
					IR_SumCheck(IR_DDEBase_Cmd);
					Uart3Send(IR_DDEBase_Cmd,MyStrlen(IR_DDEBase_Cmd));
					
					IR_DDE_Cmd[0] = (OsdRefresh_Family[_IR_Enhance].Data*20*2) ;//
					IR_DDEBase_Cmd[10] = (OsdRefresh_Family[_IR_Enhance].Data*20*2 & 0xff );//基图
					IR_DDEBase_Cmd[11] = (OsdRefresh_Family[_IR_Enhance].Data*20*2 >> 8 ) & 0xff ;//基图
					IR_SumCheck(IR_DDE_Cmd);
					Uart3Send(IR_DDEBase_Cmd,MyStrlen(IR_DDEBase_Cmd));
#elif BT656
				if(OsdRefresh_Family[_IR_Enhance].Data > 1)
						OsdRefresh_Family[_IR_Enhance].Data -= Brightness_step;
					
					IR_DDE_Cmd[2] = (OsdRefresh_Family[_IR_Enhance].Data);//基图
					IR_SumCheck(IR_DDE_Cmd);
					Uart3Send(IR_DDE_Cmd,MyStrlen(IR_DDE_Cmd));
				
#endif				
					
					DecToHexToAscii(OsdRefresh_Family[_IR_Enhance].Data, 0, OsdRefresh_Family[_IR_Enhance].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_IR_Enhance].Module_addr);
					OsdRefresh_Family[_IR_Enhance].Refresh_Flag = Refresh_yes;


					break;
#if ChengDu					
				case _IR_DNR :

					if(OsdRefresh_Family[_IR_DNR].Data > 1)
						OsdRefresh_Family[_IR_DNR].Data -= Brightness_step;
					
					IR_DNR_Cmd[10] = OsdRefresh_Family[_IR_DNR].Data * 2;
					IR_SumCheck(IR_Contract_Cmd);
					Uart3Send(IR_DNR_Cmd,MyStrlen(IR_DNR_Cmd));
					DecToHexToAscii(OsdRefresh_Family[_IR_DNR].Data, 0, OsdRefresh_Family[_IR_DNR].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_IR_DNR].Module_addr);
					OsdRefresh_Family[_IR_DNR].Refresh_Flag = Refresh_yes;
					break;

#elif BT656
			    case _IR_OutDoor :
						if(OsdRefresh_Family[_IR_OutDoor].Data != _OutDoor_Off)
						{
						 OutDoor_Pra = _OutDoor_Off;
						 Set_Osd_OutDoor(OutDoor_Pra);	
						 Uart3Send(IR_OutDoor_OFF_Cmd,MyStrlen(IR_OutDoor_OFF_Cmd));	
						 OsdRefresh_Family[_IR_OutDoor].Data -= Brightness_step;
						 OsdRefresh_Family[_IR_OutDoor].Refresh_Flag = Refresh_yes;

						}
					break;	

#endif				

				case _IR_Polar :
					if(OsdRefresh_Family[_IR_Polar].Data > _WhiteHot)
						 OsdRefresh_Family[_IR_Polar].Data -= Brightness_step;
					
					switch(OsdRefresh_Family[_IR_Polar].Data)
					{
							case _WhiteHot:
								if(Osd_Infrared_ColorMode == _WhiteHot)
								{
									break;
								}
								Osd_Infrared_ColorMode = _WhiteHot;
								Uart3Send(IR_Polar_WHot_Cmd,MyStrlen(IR_Polar_WHot_Cmd));
								break;
							case _BlackHot:
								Osd_Infrared_ColorMode = _BlackHot;
								Uart3Send(IR_Polar_BHot_Cmd,MyStrlen(IR_Polar_BHot_Cmd));
								break;
#if ChengDu 							
							case _Rainbow:
								Osd_Infrared_ColorMode = _Rainbow;
								//关闭条纹降噪
//								IR_BT656_StripeDenoising_Cmd[10] = 0x00;
//								IR_SumCheck(IR_BT656_StripeDenoising_Cmd);
//								Uart3Send(IR_BT656_StripeDenoising_Cmd,MyStrlen(IR_BT656_StripeDenoising_Cmd));
								//开启rainbow模式
								Uart3Send(IR_Polar_RainBow_Cmd,MyStrlen(IR_Polar_RainBow_Cmd));
								break;
#elif BT656
							
							
#endif
							case _Iron:
								Osd_Infrared_ColorMode = _Iron;
								Uart3Send(IR_Polar_Iron_Cmd,MyStrlen(IR_Polar_Iron_Cmd));
								break;
							case _GreenHot:
								if(Osd_Infrared_ColorMode == _GreenHot)
								{
									break;
								}
								Osd_Infrared_ColorMode = _GreenHot;
								Uart3Send(IR_Polar_Green_Cmd,MyStrlen(IR_Polar_Green_Cmd));
								break;
							default:
								break;					
					}
					
					OsdRefresh_Family[_IR_Polar].Refresh_Flag = Refresh_yes;
					Set_Osd_Infrared_ColorMode(Osd_Infrared_ColorMode);
							
					OsdRefresh_Family[_Infrared_ColorMode].Refresh_Flag = Refresh_yes;

					break;
							
				case _IR_PR ://录像拍照
					if(OsdRefresh_Family[_IR_PR].Data >	0)
					{
						//一级菜单图标显示
						OsdRun_Mode = _PROFF;//开启拍照录像功能默认拍照
						Set_Osd_PhotoRecord(OsdRun_Mode);
						OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_yes;
						
						//配置菜单图标显示
						OsdRefresh_Family[_IR_PR].Data -= 1;
						OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_yes;
						OsdRefresh_Family[_VL_PR].Data -= 1;
						OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_yes;
						Flag_PhotoRecordeEnable = FALSE;
					}

					break;
				
#if WiFi_Flag				
				case _IR_Wifi :
					Wifi_OFF();
					if(OsdRefresh_Family[_IR_Wifi].Data > 0)
					{
						//一级菜单图标显示
						WIFI_Mode = _WIFI_OFF;
						Set_Osd_Wifi(WIFI_Mode);
						OsdRefresh_Family[_Wifi].Refresh_Flag = Refresh_yes;
						
						//配置菜单图标显示
						OsdRefresh_Family[_IR_Wifi].Data -= Brightness_step;
						OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_yes;
						OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_yes;
					}

					break;
#endif		
				
//				case _IR_Exit :

//					break;
				
				default:
					
					break;
			}
		
		}
		
		
		//白光
		else if(OsdLight_Mode == _Daylight)
		{
			switch(*ConfigMenuPra)
			{
				case _VL_Brightness :
					if(OsdRefresh_Family[_VL_Brightness].Data > 1)
						OsdRefresh_Family[_VL_Brightness].Data -= Brightness_step;
					
#if VL_YT_3578_HD
					
					VL_Bright_Cmd[3] = OsdRefresh_Family[_VL_Brightness].Data * 2;// +1;
					
					
#elif VL_MC_105Q

					
					VL_Bright_Cmd[7] = OsdRefresh_Family[_VL_Brightness].Data * 2;// +1;
					
					if(VL_Bright_Cmd[7] > 0xf)
					{
						VL_Bright_Cmd[6] = 1;
						VL_Bright_Cmd[7] = VL_Bright_Cmd[7]- 0xf;
					}
					else	
					{
						VL_Bright_Cmd[6] = 0;
					}
					
#endif						
					
					Uart6Send(VL_Bright_Cmd,MyStrlen(VL_Bright_Cmd));
					
					DecToHexToAscii(OsdRefresh_Family[_VL_Brightness].Data, 0, OsdRefresh_Family[_VL_Brightness].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_VL_Brightness].Module_addr);
					OsdRefresh_Family[_VL_Brightness].Refresh_Flag = Refresh_yes;

					break;
				
				case _VL_ContrastRatio :
					if(OsdRefresh_Family[_VL_ContrastRatio].Data > 1)
						OsdRefresh_Family[_VL_ContrastRatio].Data -= Brightness_step;
					
#if  VL_MC_105Q
					
		            VL_Contract_Cmd[7] = OsdRefresh_Family[_VL_ContrastRatio].Data * 2;// +1;
					
					if(VL_Contract_Cmd[7] > 0xf)
					{
						VL_Contract_Cmd[6] = 1;
						VL_Contract_Cmd[7] = VL_Contract_Cmd[7]- 0xf;
					}
					else	
					{
						VL_Contract_Cmd[6] = 0;
					}
					
					Uart6Send(VL_Contract_Cmd,MyStrlen(VL_Contract_Cmd));
										
#elif  VL_YT_3578_HD

		            VL_Contract_Cmd[3] = OsdRefresh_Family[_VL_ContrastRatio].Data * 2;// +1;
					
		            Uart6Send(VL_Contract_Cmd,MyStrlen(VL_Contract_Cmd));

#endif
					DecToHexToAscii(OsdRefresh_Family[_VL_ContrastRatio].Data, 0, OsdRefresh_Family[_VL_ContrastRatio].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_VL_ContrastRatio].Module_addr);
					OsdRefresh_Family[_VL_ContrastRatio].Refresh_Flag = Refresh_yes;

					break;
					
					case _VL_Mode :
					if(OsdRefresh_Family[_VL_Mode].Data > _Auto)
						OsdRefresh_Family[_VL_Mode].Data -= 1;
					
							switch(OsdRefresh_Family[_VL_Mode].Data)
							{
									case _Auto:
										Osd_Daylight_ColorMode = _Auto;
										Uart6Send(VL_Mode_Defog_OFF_Cmd,MyStrlen(VL_Mode_Defog_OFF_Cmd));
										Uart6Send(VL_Mode_Auto_Cmd,MyStrlen(VL_Mode_Auto_Cmd));
										break;
									case _Day:
										Osd_Daylight_ColorMode = _Day;
										Uart6Send(VL_Mode_Defog_OFF_Cmd,MyStrlen(VL_Mode_Defog_OFF_Cmd));
										Uart6Send(VL_Mode_Day_Cmd,MyStrlen(VL_Mode_Day_Cmd));
										break;
									case _Defog_Low:
										Osd_Daylight_ColorMode = _Defog_Low;
										Uart6Send(VL_Mode_Defog_ON_Cmd,MyStrlen(VL_Mode_Defog_ON_Cmd));
										Uart6Send(VL_Mode_Defog_Low_Cmd,MyStrlen(VL_Mode_Defog_Low_Cmd));
										break;
									case _Defog_Mid:
										Osd_Daylight_ColorMode = _Defog_Mid;
										Uart6Send(VL_Mode_Defog_ON_Cmd,MyStrlen(VL_Mode_Defog_ON_Cmd));
										Uart6Send(VL_Mode_Defog_Mid_Cmd,MyStrlen(VL_Mode_Defog_Mid_Cmd));
										break;
									case _Defog_Hig:
										Osd_Daylight_ColorMode = _Defog_Hig;
										Uart6Send(VL_Mode_Defog_ON_Cmd,MyStrlen(VL_Mode_Defog_ON_Cmd));
										Uart6Send(VL_Mode_Defog_Hig_Cmd,MyStrlen(VL_Mode_Defog_Hig_Cmd));
										break;
									case _Night:
										Osd_Daylight_ColorMode = _Night;
										Uart6Send(VL_Mode_Defog_OFF_Cmd,MyStrlen(VL_Mode_Defog_OFF_Cmd));
										Uart6Send(VL_Mode_Night_Cmd,MyStrlen(VL_Mode_Night_Cmd));
										break;
									default:
										Osd_Daylight_ColorMode = _Auto;
										OsdRefresh_Family[_VL_Mode].Data = 0;
										Uart6Send(VL_Mode_Defog_OFF_Cmd,MyStrlen(VL_Mode_Defog_OFF_Cmd));
										Uart6Send(VL_Mode_Auto_Cmd,MyStrlen(VL_Mode_Auto_Cmd));
										break;					
							}
					
					Set_Osd_Daylight_ColorMode(Osd_Daylight_ColorMode);
					OsdRefresh_Family[_Daylight_ColorMode].Refresh_Flag = Refresh_yes;
					OsdRefresh_Family[_VL_Mode].Refresh_Flag = Refresh_yes;

					break;

				case _VL_DWDR :			
				
					
#if  VL_MC_105Q
					if(OsdRefresh_Family[_VL_DWDR].Data > _DWR_Off)
						 OsdRefresh_Family[_VL_DWDR].Data -= 1;
							switch(OsdRefresh_Family[_VL_DWDR].Data)
							{
									case _DWR_Off:
										DWR_Pra = _DWR_Off;
										Uart6Send((uint8_t*)VL_DWDR_Off_Cmd,MyStrlen(VL_DWDR_Off_Cmd));
										break;
									case _DWR_Low:
										DWR_Pra = _DWR_Low;
										Uart6Send((uint8_t*)VL_DWDR_On_Cmd,MyStrlen(VL_DWDR_On_Cmd));
										Uart6Send((uint8_t*)VL_DWDR_AutoMode_Cmd,MyStrlen(VL_DWDR_AutoMode_Cmd));
										Uart6Send((uint8_t*)VL_DWDR_Low_Cmd,MyStrlen(VL_DWDR_Low_Cmd));
										break;
									case _DWR_Mid:
										DWR_Pra = _DWR_Mid;
										Uart6Send((uint8_t*)VL_DWDR_On_Cmd,MyStrlen(VL_DWDR_On_Cmd));
										Uart6Send((uint8_t*)VL_DWDR_AutoMode_Cmd,MyStrlen(VL_DWDR_AutoMode_Cmd));
										Uart6Send((uint8_t*)VL_DWDR_Mid_Cmd,MyStrlen(VL_DWDR_Mid_Cmd));
										break;
									case _DWR_Hig:
										DWR_Pra = _DWR_Hig;
										Uart6Send((uint8_t*)VL_DWDR_On_Cmd,MyStrlen(VL_DWDR_On_Cmd));
										Uart6Send((uint8_t*)VL_DWDR_AutoMode_Cmd,MyStrlen(VL_DWDR_AutoMode_Cmd));
										Uart6Send((uint8_t*)VL_DWDR_Hig_Cmd,MyStrlen(VL_DWDR_Hig_Cmd));
										break;
									default:
										break;					
							}
												
#elif   VL_YT_3578_HD
                       if(OsdRefresh_Family[_VL_DWDR].Data > _DWR_Low)
						   OsdRefresh_Family[_VL_DWDR].Data -= 1;
							switch(OsdRefresh_Family[_VL_DWDR].Data)
							{
									case _DWR_Low:
										DWR_Pra = _DWR_Low;
										Uart6Send((uint8_t*)VL_DWDR_Low_Cmd,MyStrlen(VL_DWDR_Low_Cmd));
										break;
									case _DWR_Mid:
										DWR_Pra = _DWR_Mid;
										Uart6Send((uint8_t*)VL_DWDR_Mid_Cmd,MyStrlen(VL_DWDR_Mid_Cmd));
										break;
									case _DWR_Hig:
										DWR_Pra = _DWR_Hig;
										Uart6Send((uint8_t*)VL_DWDR_Hig_Cmd,MyStrlen(VL_DWDR_Hig_Cmd));
										break;
									default:
										break;					
							}
							
#endif
					

					OsdRefresh_Family[_VL_DWDR].Refresh_Flag = Refresh_yes;
					//设置白光模式下的动态范围
					Set_Osd_Daylight_DWDR(DWR_Pra);


					break;
							
				case _VL_DNR ://降噪
#if VL_MC_105Q

					if(OsdRefresh_Family[_VL_DNR].Data > 1)
						OsdRefresh_Family[_VL_DNR].Data -= 1;
					
					VL_DNR_Cmd[5] = OsdRefresh_Family[_VL_DNR].Data * 2;
					
					Uart6Send(VL_DNR_Cmd,MyStrlen(VL_DNR_Cmd));
					
					DecToHexToAscii(OsdRefresh_Family[_VL_DNR].Data, 0, OsdRefresh_Family[_VL_DNR].Module_addr, 1);
					SmallToBig(OsdRefresh_Family[_VL_DNR].Module_addr);
					OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_yes;
					break;
				
#elif VL_YT_3578_HD
				
				  if(OsdRefresh_Family[_VL_DNR].Data > _DNR_Off)
						 OsdRefresh_Family[_VL_DNR].Data -= 1;
							switch(OsdRefresh_Family[_VL_DNR].Data)
							{
									case _DNR_Off:
										DNR_Pra = _DNR_Off;
										Uart6Send((uint8_t*)VL_DNR_Off_Cmd,MyStrlen(VL_DNR_Off_Cmd));
										break;								
								
									case _DNR_Low:
										DNR_Pra = _DNR_Low;
										Uart6Send((uint8_t*)VL_DNR_Low_Cmd,MyStrlen(VL_DNR_Low_Cmd));
										break;
									case _DNR_Mid:
										DNR_Pra = _DNR_Mid;
										Uart6Send((uint8_t*)VL_DNR_Mid_Cmd,MyStrlen(VL_DNR_Mid_Cmd));
										break;
									case _DNR_Hig:
										DNR_Pra = _DNR_Hig;
										Uart6Send((uint8_t*)VL_DNR_Hig_Cmd,MyStrlen(VL_DNR_Hig_Cmd));
										break;
									default:
										break;		
							}									
					
					OsdRefresh_Family[_VL_DNR].Refresh_Flag = Refresh_yes;
					//设置白光模式下的动态范围
					Set_Osd_Daylight_DNR(DNR_Pra);


					break;
#endif	
				case _VL_PR ://录像拍照
					
					if(OsdRefresh_Family[_VL_PR].Data >	0)
					{
						//一级菜单图标显示
						OsdRun_Mode = _PROFF;//开启拍照录像功能默认拍照
						Set_Osd_PhotoRecord(OsdRun_Mode);
						OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_yes;
						
						//配置菜单图标显示
						OsdRefresh_Family[_VL_PR].Data -= 1;
						OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_yes;
						
						OsdRefresh_Family[_IR_PR].Data -= 1;
						OsdRefresh_Family[_IR_PR].Refresh_Flag = Refresh_yes;
						Flag_PhotoRecordeEnable = FALSE;
					}

					break;
				
#if WiFi_Flag					
				case _VL_Wifi :
					Wifi_OFF();
					if(OsdRefresh_Family[_VL_Wifi].Data > 0)
					{
						//一级菜单图标显示
						WIFI_Mode = _WIFI_OFF;
						Set_Osd_Wifi(WIFI_Mode);
						OsdRefresh_Family[_Wifi].Refresh_Flag = Refresh_yes;
						
						//配置菜单图标显示
						OsdRefresh_Family[_VL_Wifi].Data -= 1;						
						OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_yes;
						OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_yes;
					}

					break;
				
#endif	
				
//				case _IR_Exit :

//					break;
				
				default:
					
					break;
			}
				
		}
			
	}
	

//电池电量展示
int BatteryShow(void)
{
	static uint32_t BatterySum=0;
	static uint8_t timeCycle;
	static uint8_t num=0;
	static float BatteryDate;
	
	if(timeCycle < 1) //1s
	{
		timeCycle++;
		return 0;
	}
	
	timeCycle = 0;
	
	if(num < BatterySample_MAXNUM)
	{
		BatteryDate = adc_ordinary_conversion_data_get(ADC1);
		BatterySum += BatteryDate;
		num ++;
		return 0;
	}
	
	num = 0;
	BatteryDate = BatterySum / BatterySample_MAXNUM;
	BatterySum = 0;
	
	_BatteryState BatteryState;
	
#if One_S
	
	static float step = 0.24;
	static float Power_Offect = 3;	
	BatteryDate = adc_ordinary_conversion_data_get(ADC1) * 14.4222 / 4095.0;
	
#elif Three_S
	
	static float step = 0.6;
  static float Power_Offect = 10;
	BatteryDate = BatteryDate / 247.0 +0.04;
	
#endif	
	
	if(BatteryDate <= Power_Offect+0.00) 	BatteryState = _Percent0;  	//0%
	if(BatteryDate > Power_Offect+0.00   && BatteryDate <= Power_Offect+step)  BatteryState  = _Percent20; 	//20%
	if(BatteryDate > Power_Offect+step   && BatteryDate <= Power_Offect+2*step) BatteryState = _Percent40;	//40%
	if(BatteryDate > Power_Offect+2*step && BatteryDate <= Power_Offect+3*step) BatteryState = _Percent70;	//70%
	if(BatteryDate > Power_Offect+3*step && BatteryDate <= Power_Offect+4*step) BatteryState = _Percent100;	//100%
	
	
	switch(BatteryState)
	{
		case _Percent0:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_Icon_Battery_Per0_1;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_Icon_Battery_Per0_2;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
		case _Percent10:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_1;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_0;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
		case _Percent20:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_Icon_Battery_Per20_1;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_Icon_Battery_Per20_2;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
		case _Percent30:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_3;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_0;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
		case _Percent40:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_Icon_Battery_Per40_1;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_Icon_Battery_Per40_2;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
		case _Percent50:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_Icon_Battery_Per100_1;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_Icon_Battery_Per20_2;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
		case _Percent60:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_Icon_Battery_Per60_1;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_Icon_Battery_Per60_2;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
		case _Percent70:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_Icon_Battery_Per70_1;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_Icon_Battery_Per70_2;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
		case _Percent80:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_Icon_Battery_Per100_1;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_Icon_Battery_Per60_2;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
		case _Percent90:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_9;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_0;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
		case _Percent100:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_Icon_Battery_Per100_1;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_Icon_Battery_Per100_2;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
		
		default:
			OsdRefresh_Family[_Power].Module_addr[0] = osd_Icon_Battery_Per100_1;
			OsdRefresh_Family[_Power].Module_addr[1] = osd_Icon_Battery_Per100_2;
			OsdRefresh_Family[_Power].Refresh_Flag = Refresh_yes;
		break;
																				
	}
	adc_ordinary_software_trigger_enable(ADC1, TRUE);
	return 1;
}






 

/**
 * @brief  bsp debug
 * @param  none
 * @retval none
 */
void VL_IR_Driver(void)
{
    gpio_init_type gpio_init_struct;
    crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
	crm_periph_clock_enable(CRM_GPIOH_PERIPH_CLOCK, TRUE);
    gpio_default_para_init(&gpio_init_struct);

    gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
    gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
    gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
    gpio_init_struct.gpio_pins = GPIO_PINS_2;
    gpio_init_struct.gpio_pull = GPIO_PULL_UP;
    gpio_init(GPIOB, &gpio_init_struct);
	
	gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
    gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
    gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
    gpio_init_struct.gpio_pins = GPIO_PINS_3;
    gpio_init_struct.gpio_pull = GPIO_PULL_UP;
    gpio_init(GPIOH, &gpio_init_struct);

#if Frist_VL	
	SetVLmode();
#elif Frist_IR
    SetIRmode();
#endif
}

void Init_PowerIO(void)
{
	gpio_init_type gpio_init_struct;
    crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
	
    gpio_default_para_init(&gpio_init_struct);

    gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
    gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
    gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
    gpio_init_struct.gpio_pins = GPIO_PINS_3|GPIO_PINS_4; //3可见光电源 4激光电源
    gpio_init_struct.gpio_pull = GPIO_PULL_UP;
    gpio_init(GPIOB, &gpio_init_struct);
	
	gpio_bits_write(GPIOB, GPIO_PINS_3, 0);
	gpio_bits_write(GPIOH, GPIO_PINS_4, 0);
}


void SetVLmode(void)
{
	gpio_bits_write(GPIOB, GPIO_PINS_2, 1);//视频信号EN
	gpio_bits_write(GPIOH, GPIO_PINS_3, 0);//VID_SW //1.IR,0.VL
#if Power_Flag	
	gpio_bits_write(GPIOB, GPIO_PINS_3, 1);
#endif
	OsdLight_Mode = _Daylight; 
	
}

void SetIRmode(void)
{
	gpio_bits_write(GPIOB, GPIO_PINS_2, 1);//视频信号EN
	gpio_bits_write(GPIOH, GPIO_PINS_3, 1);//VID_SW //1.IR,0.VL
#if Power_Flag
	gpio_bits_write(GPIOB, GPIO_PINS_3, 0);
#endif
	OsdLight_Mode = _Infrared;
}

void VL_ZoomStop(void)
{
	Uart6Send(VL_ZoomStop_Cmd, MyStrlen(VL_ZoomStop_Cmd));
}

void VL_Zoom_DZoomSet(uint8_t data)
{
	uint8_t state = data;
#if VL_MC_105Q
	switch(state)
	{
		case 1:
			VL_ZoomSet_Cmd[4] = (zoom_x1>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x1>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x1>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x1>>0)  & 0xf;
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 2:
			VL_ZoomSet_Cmd[4] = (zoom_x2>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x2>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x2>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x2>>0)  & 0xf;
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 3:
			VL_ZoomSet_Cmd[4] = (zoom_x3>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x3>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x3>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x3>>0)  & 0xf;
			//VL_DZoomOFF();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 4:
			VL_ZoomSet_Cmd[4] = (zoom_x4>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x4>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x4>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x4>>0)  & 0xf;
			//VL_DZoomOFF();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 5:
			VL_ZoomSet_Cmd[4] = (zoom_x5>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x5>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x5>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x5>>0)  & 0xf;
			//VL_DZoomOFF();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 6:
			VL_ZoomSet_Cmd[4] = (zoom_x6>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x6>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x6>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x6>>0)  & 0xf;
			//VL_DZoomOFF();
			Uart6Send(VL_ZoomSet_Cmd, 9);
			break;
		case 7:
			VL_ZoomSet_Cmd[4] = (zoom_x7>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x7>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x7>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x7>>0)  & 0xf;
			//VL_DZoomOFF();
			Uart6Send(VL_ZoomSet_Cmd, 9);
			break;
		case 8:
			VL_ZoomSet_Cmd[4] = (zoom_x8>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x8>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x8>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x8>>0)  & 0xf;
			//VL_DZoomOFF();
			Uart6Send(VL_ZoomSet_Cmd, 9);
			break;
		
		case 9:
			VL_ZoomSet_Cmd[4] = (zoom_x9>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x9>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x9>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x9>>0)  & 0xf;
			//VL_DZoomOFF();
			Uart6Send(VL_ZoomSet_Cmd, 9);
			break;
		
		//Dzoom
		case 10:
			VL_ZoomSet_Cmd[4] = (zoom_x10>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x10>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x10>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x10>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 11:
			VL_ZoomSet_Cmd[4] = (zoom_x11>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x11>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x11>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x11>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 12:
			VL_ZoomSet_Cmd[4] = (zoom_x12>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x12>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x12>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x12>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 13:
			VL_ZoomSet_Cmd[4] = (zoom_x13>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x13>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x13>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x13>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 14:
			VL_ZoomSet_Cmd[4] = (zoom_x14>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x14>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x14>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x14>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 15:
			VL_ZoomSet_Cmd[4] = (zoom_x15>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x15>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x15>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x15>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 16:
			VL_ZoomSet_Cmd[4] = (zoom_x10>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x10>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x10>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x10>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 17:
			VL_ZoomSet_Cmd[4] = (zoom_x11>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x11>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x11>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x11>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 18:
			VL_ZoomSet_Cmd[4] = (zoom_x12>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x12>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x12>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x12>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 19:
			VL_ZoomSet_Cmd[4] = (zoom_x13>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x13>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x13>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x13>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 20:
			VL_ZoomSet_Cmd[4] = (zoom_x14>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x14>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x14>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x14>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 21:
			VL_ZoomSet_Cmd[4] = (zoom_x15>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x15>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x15>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x15>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		
		case 22:
			VL_ZoomSet_Cmd[4] = (zoom_x15>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x15>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x15>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x15>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 23:
			VL_ZoomSet_Cmd[4] = (zoom_x10>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x10>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x10>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x10>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 24:
			VL_ZoomSet_Cmd[4] = (zoom_x11>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x11>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x11>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x11>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 25:
			VL_ZoomSet_Cmd[4] = (zoom_x12>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x12>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x12>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x12>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 26:
			VL_ZoomSet_Cmd[4] = (zoom_x13>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x13>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x13>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x13>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 27:
			VL_ZoomSet_Cmd[4] = (zoom_x14>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x14>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x14>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x14>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 28:
			VL_ZoomSet_Cmd[4] = (zoom_x15>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x15>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x15>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x15>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		
		case 29:
			VL_ZoomSet_Cmd[4] = (zoom_x12>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x12>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x12>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x12>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 30:
			VL_ZoomSet_Cmd[4] = (zoom_x13>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x13>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x13>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x13>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 31:
			VL_ZoomSet_Cmd[4] = (zoom_x14>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x14>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x14>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x14>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		case 32:
			VL_ZoomSet_Cmd[4] = (zoom_x15>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x15>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x15>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x15>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		
		case 33:
			VL_ZoomSet_Cmd[4] = (zoom_x15>>12) & 0xf;
			VL_ZoomSet_Cmd[5] = (zoom_x15>>8)  & 0xf;
			VL_ZoomSet_Cmd[6] = (zoom_x15>>4)  & 0xf;
			VL_ZoomSet_Cmd[7] = (zoom_x15>>0)  & 0xf;
		
			VL_DZoomON();
			VL_DZoomCombine();
			Uart6Send(VL_ZoomSet_Cmd, MyStrlen(VL_ZoomSet_Cmd));
			break;
		default:
			break;											
	}

#elif VL_YT_3578_HD

switch(state)
	{
		case 1:
			VL_AZoomSet_Cmd[3] = 0X00;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 2:
			VL_AZoomSet_Cmd[3] = 0X01;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 3:
			VL_AZoomSet_Cmd[3] = 0X02;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 4:
			VL_AZoomSet_Cmd[3] = 0X03;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 5:
			VL_AZoomSet_Cmd[3] = 0X04;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 6:
	    VL_AZoomSet_Cmd[3] = 0X05;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 7:
			VL_AZoomSet_Cmd[3] = 0X06;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 8:
			VL_AZoomSet_Cmd[3] = 0X07;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 9:
			VL_AZoomSet_Cmd[3] = 0X08;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 10:
			VL_AZoomSet_Cmd[3] = 0X09;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 11:
			VL_AZoomSet_Cmd[3] = 0X0A;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 12:
	    VL_AZoomSet_Cmd[3] = 0X0B;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 13:
	    VL_AZoomSet_Cmd[3] = 0X0C;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 14:
			VL_AZoomSet_Cmd[3] = 0X0D;
			Uart6Send(VL_AZoomSet_Cmd, 6);
			break;
		case 15:
			VL_AZoomSet_Cmd[3] = 0X0E;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		case 16:
	    VL_AZoomSet_Cmd[3] = 0X0F;
			Uart6Send(VL_AZoomSet_Cmd, MyStrlen(VL_AZoomSet_Cmd));
			break;
		
		default:
			break;											
	}
#endif
}


void VL_DZoomON(void)
{
	Uart6Send(VL_DZoomON_Cmd, MyStrlen(VL_DZoomON_Cmd));
}

void VL_DZoomOFF(void)
{
	Uart6Send(VL_DZoomOFF_Cmd, MyStrlen(VL_DZoomOFF_Cmd));
}

void VL_DZoomStop(void)
{
	Uart6Send(VL_DZoomStop_Cmd, MyStrlen(VL_DZoomStop_Cmd));
}

void VL_DZoomCombine(void)
{
	Uart6Send(VL_DZoom_CombineMode_Cmd, MyStrlen(VL_DZoom_CombineMode_Cmd));
}

void VL_DZoomSeparate(void)
{
	Uart6Send(VL_DZoom_SepatateMode_Cmd, MyStrlen(VL_DZoom_SepatateMode_Cmd));
}


void VLRestart_Reset(void)
{
	
	//白光
	OsdRefresh_Family[_VL_Brightness].Data = 5;

#if VL_MC_105Q

	VL_Bright_Cmd[7] = OsdRefresh_Family[_VL_Brightness].Data * 2;// +1;
	if(VL_Bright_Cmd[7] > 0xf)
	{
		VL_Bright_Cmd[6] = 1;
		VL_Bright_Cmd[7] = VL_Bright_Cmd[7]- 0xf;
	}
	else	
	{
		VL_Bright_Cmd[6] = 0;
	}
	
#elif VL_YT_3578_HD

	VL_Bright_Cmd[3] = OsdRefresh_Family[_VL_Brightness].Data * 2;// +1;
	
#endif

	
	//Uart6Send(VL_Bright_Cmd,MyStrlen(VL_Bright_Cmd));
	
	DecToHexToAscii(OsdRefresh_Family[_VL_Brightness].Data, 0, OsdRefresh_Family[_VL_Brightness].Module_addr, 1);
	SmallToBig(OsdRefresh_Family[_VL_Brightness].Module_addr);
	//OsdRefresh_Family[_VL_Brightness].Refresh_Flag = Refresh_yes;

	OsdRefresh_Family[_VL_ContrastRatio].Data = 5;
	
	
#if  VL_MC_105Q
					
		 VL_Contract_Cmd[7] = OsdRefresh_Family[_VL_ContrastRatio].Data * 2;// +1;
					
					if(VL_Contract_Cmd[7] > 0xf)
					{
						VL_Contract_Cmd[6] = 1;
						VL_Contract_Cmd[7] = VL_Contract_Cmd[7]- 0xf;
					}
					else	
					{
						VL_Contract_Cmd[6] = 0;
					}
										
#elif  VL_YT_3578_HD

		 VL_Contract_Cmd[3] = OsdRefresh_Family[_VL_ContrastRatio].Data * 2;// +1;
					
#endif
					
	
	DecToHexToAscii(OsdRefresh_Family[_VL_ContrastRatio].Data, 0, OsdRefresh_Family[_VL_ContrastRatio].Module_addr, 1);
	SmallToBig(OsdRefresh_Family[_VL_ContrastRatio].Module_addr);
	
	OsdRefresh_Family[_VL_Mode].Data = _Day;
	Osd_Daylight_ColorMode = _Day;
			
	Set_Osd_Daylight_ColorMode(Osd_Daylight_ColorMode);

#if VL_MC_105Q
	OsdRefresh_Family[_VL_DWDR].Data = _DWR_Off;
	DWR_Pra = _DWR_Off;
	OsdRefresh_Family[_VL_DNR].Data = 1;
	VL_DNR_Cmd[5] = OsdRefresh_Family[_VL_DNR].Data * 2;
	//Uart6Send(VL_DNR_Cmd,MyStrlen(VL_DNR_Cmd));
	DecToHexToAscii(OsdRefresh_Family[_VL_DNR].Data, 0, OsdRefresh_Family[_VL_DNR].Module_addr, 1);
	SmallToBig(OsdRefresh_Family[_VL_DNR].Module_addr);
#elif VL_YT_3578_HD

	OsdRefresh_Family[_VL_DWDR].Data = _DWR_Low;
	DWR_Pra = _DWR_Low;
	
	OsdRefresh_Family[_VL_DNR].Data = _DNR_Off;
	DNR_Pra = _DNR_Off;
	Set_Osd_Daylight_DNR(DNR_Pra);
	

#endif

	//设置白光模式下的动态范围
	Set_Osd_Daylight_DWDR(DWR_Pra);




	//一级菜单图标显示
	OsdRun_Mode = _PROFF;//开启拍照录像功能默认拍照
	Set_Osd_PhotoRecord(OsdRun_Mode);
	OsdRefresh_Family[_PhotoRecord].Refresh_Flag = Refresh_yes;

	//配置菜单图标显示
	OsdRefresh_Family[_VL_PR].Data = _PROFF;
	//OsdRefresh_Family[_VL_PR].Refresh_Flag = Refresh_yes;
	Flag_PhotoRecordeEnable = FALSE;

#if WiFi_Flag
	Wifi_OFF();
	//一级菜单图标显示
	WIFI_Mode = _WIFI_OFF;
	Set_Osd_Wifi(WIFI_Mode);
	OsdRefresh_Family[_Wifi].Refresh_Flag = Refresh_yes;

	//配置菜单图标显示
	OsdRefresh_Family[_VL_Wifi].Data = _WIFI_OFF;
#endif					
	//OsdRefresh_Family[_VL_Wifi].Refresh_Flag = Refresh_yes;
	//OsdRefresh_Family[_IR_Wifi].Refresh_Flag = Refresh_yes;		
	
}

void IR_ZoomShow(uint8_t data)
{
	switch(data)
	{
		case 0:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[2] = '\r';
			break;
		case 1:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_NONE;
			OsdRefresh_Family[_IR_Zoom].Module_addr[2] = '\r';
			break;
		case 2:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_2;
			OsdRefresh_Family[_IR_Zoom].Module_addr[2] = '\r';
			break;
		case 3:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_3;
			OsdRefresh_Family[_IR_Zoom].Module_addr[2] = '\r';
			break;
		case 4:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_4;
			OsdRefresh_Family[_IR_Zoom].Module_addr[2] = '\r';
			break;
		case 5:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_5;
			OsdRefresh_Family[_IR_Zoom].Module_addr[2] = '\r';
			break;
		case 6:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_6;
			OsdRefresh_Family[_IR_Zoom].Module_addr[2] = '\r';
			break;
		case 7:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_7;
			OsdRefresh_Family[_IR_Zoom].Module_addr[2] = '\r';
			break;
		case 8:
			OsdRefresh_Family[_IR_Zoom].Module_addr[0] = osd_X;
			OsdRefresh_Family[_IR_Zoom].Module_addr[1] = osd_8;
			OsdRefresh_Family[_IR_Zoom].Module_addr[2] = '\r';
			break;
		
		default:
			break;
																
	}
}

void ShowLoading(void)
{
	
	OsdRefresh_Family[_AimLine].Module_addr[0] = osd_NONE ;
	OsdRefresh_Family[_AimLine].Module_addr[1] = osd_NONE ;
	OsdRefresh_Family[_AimLine].Module_addr[2] = osd_NONE ;
	OsdRefresh_Family[_AimLine].Module_addr[3] = osd_NONE ;
	OsdRefresh_Family[_AimLine].Refresh_Flag = Refresh_no;
	OsdDisplay_Module(OsdRefresh_Family[_AimLine].Module_local,	OsdRefresh_Family[_AimLine].Module_addr,4,	OsdRefresh_Family[_AimLine].Module_Property);//显示
	
	OsdRefresh_Family[_Loading].Module_addr[0] = osd_L;
	OsdRefresh_Family[_Loading].Module_addr[1] = osd_O;
	OsdRefresh_Family[_Loading].Module_addr[2] = osd_A;
	OsdRefresh_Family[_Loading].Module_addr[3] = osd_D;
	OsdRefresh_Family[_Loading].Module_addr[4] = osd_I;
	OsdRefresh_Family[_Loading].Module_addr[5] = osd_N;
	OsdRefresh_Family[_Loading].Module_addr[6] = osd_G;
	OsdRefresh_Family[_Loading].Module_addr[7] = osd_Icon_point;
	OsdRefresh_Family[_Loading].Module_addr[8] = osd_Icon_point;
	OsdRefresh_Family[_Loading].Module_addr[9] = osd_Icon_point;
	OsdRefresh_Family[_Loading].Module_addr[10] = '\r';
	
	
	OsdRefresh_Family[_Loading].Refresh_Flag = Refresh_yes;//更新标志复位
	
	gpio_bits_write(GPIOB, GPIO_PINS_2, 0);//视频信号
	
	StartLoadingContinueTimer();

	
	
}

void EraseLoading(void)
{
	OsdRefresh_Family[_Loading].Module_addr[0] = osd_NONE;
	OsdRefresh_Family[_Loading].Module_addr[1] = osd_NONE;
	OsdRefresh_Family[_Loading].Module_addr[2] = osd_NONE;
	OsdRefresh_Family[_Loading].Module_addr[3] = osd_NONE;
	OsdRefresh_Family[_Loading].Module_addr[4] = osd_NONE;
	OsdRefresh_Family[_Loading].Module_addr[5] = osd_NONE;
	OsdRefresh_Family[_Loading].Module_addr[6] = osd_NONE;
	OsdRefresh_Family[_Loading].Module_addr[7] = osd_NONE;
	OsdRefresh_Family[_Loading].Module_addr[8] = osd_NONE;
	OsdRefresh_Family[_Loading].Module_addr[9] = osd_NONE;
	OsdRefresh_Family[_Loading].Module_addr[10] = '\r';
	OsdRefresh_Family[_Loading].Refresh_Flag = Refresh_no;
	OsdDisplay_Module(OsdRefresh_Family[_Loading].Module_local,	OsdRefresh_Family[_Loading].Module_addr,20,	OsdRefresh_Family[_Loading].Module_Property);//显示
	

	OsdRefresh_Family[_AimLine].Module_addr[0] = osd_Aim_line_1 ;
	OsdRefresh_Family[_AimLine].Module_addr[1] = osd_Aim_line_2 ;
	OsdRefresh_Family[_AimLine].Module_addr[2] = osd_Aim_line_3 ;
	OsdRefresh_Family[_AimLine].Module_addr[3] = osd_Aim_line_4 ;
	OsdRefresh_Family[_AimLine].Refresh_Flag = Refresh_yes;
}

